开发者

what is the equivalent in rails3 routes?

开发者 https://www.devze.com 2023-01-05 14:11 出处:网络
I have used this route in rails 2.3.5 - basically, I wanted to be able to parametrize my controller that I se开发者_Go百科nd to the named route.

I have used this route in rails 2.3.5 - basically, I wanted to be able to parametrize my controller that I se开发者_Go百科nd to the named route.

do_action "do_action/:controller" , :action => "do_action"

what is the equivalent of this in rails3 routes?

This doesn't work:

match "do_action/:controller" , :to => ":controller#do_action", :as => "do_action"

thanks


Have you tried this?

namespace :do_action do
  resources :controller
end

Which will output for a controller named pages_controller:

do_action/pages
0

精彩评论

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

关注公众号