0
我要創建其中任一值是接受了路線,我創建了一個這樣的正則表達式中的Rails路由
get '/coworking-in-:coworking_place', to: 'home#coworking', constraints: { :coworking_place => /[a-z]*[A-Z]*/ }
這是工作的罰款有以下情況:
- WWW。 aboardoffices.com/coworking-in-delhi
- www.aboardoffices.com/coworking-in-mumbai
但它不是在下列情況下工作:
- www.aboardoffices.com/coworking-in-sector7Dwarka
- www.aboardoffices.com/coworking-in-dlfPhase1Gurgaon
我想要創建可接受任何參數的路線:coworking_place