开发者

Rails: Rewrite get variables in URL to cleaner style

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜