开发者

resources :users, :as => 'members' equvalent in Rails 3

So in Rails2 you could setup a route like this:

resources :users, :as => 'members'

This way you st开发者_StackOverflow社区ill have your users_path but it matches /members

Now, how do you go about doing this in Rails3? :as parameter here means totally different thing and I can't find what makes it work as before.


I think what you're looking for is the :path option:

resources :users, :path => 'members'

Tested it on my app and the users_path still works, but matches /members as required. It doesn't match /users.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜