Resources: users: as => 'equivalent members in Rails 3

So, in Rails2, you can configure the route as follows:

resources :users, :as => 'members'

So you still have it users_path, but it matches/members

Now how do you do this in Rails3? :ashere means a completely different thing, and I cannot find what makes it work as before.

+3
source share
1 answer

I think you are looking for an option :path:

resources :users, :path => 'members'

Tested in my application, but users_pathstill works, but matches /membersas needed. He does not match /users.

+1
source

Source: https://habr.com/ru/post/1763847/


All Articles