开发者

Rails 3 Custom Routes Parameters

I want something like this in my routes.rb. This isn't at all correct, but something like this:

match '/:scope/authenticate' => '%{:scope}_authentication#create'

So going to /users/authenticate would route to the create method in the users_authenticate controller.

What is the best way to do thi开发者_开发百科s in Rails 3?


Not something I've done, but does this work?

resources :users_authenticate
resources :things_authenticate
resources :admins_authenticate
match "/:scope/authenticate" => redirect("%{scope}_authenticate/create")
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜