开发者

Rails: Rewrite get variables in URL to cleaner style

开发者 https://www.devze.com 2022-12-30 00:21 出处:网络
I am trying to figure out how to submit a search query get variables as /search/query instead of /search?search=query. An开发者_StackOverflow社区y ideas?Define route in your routes.rb

I am trying to figure out how to submit a search query get variables as /search/query instead of /search?search=query. An开发者_StackOverflow社区y ideas?


Define route in your routes.rb

map.search "/search/:search", :controller => "search", :action => "index", :conditions => { :method => :get }

restart server and check.

for more info ref Module ActionController::Routing

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号