Forum: Ruby on Rails routes from restful_authentication, wtf?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
8fa0f5c2bf8ad238baa4e20cb0360ebd?d=identicon&s=25 Matt Harrison (iwasinnamuknow)
on 2008-10-10 22:09
(Received via mailing list)
Hey,

Can someone please explain what these routes from restful_authentication
map out to?

I'm trying to move the administrative actions from a RA based login
system to an admin namespace but thanks to this routing I'm unsure about
what to move where.

 map.resources :users, :member => { :enable => :put } do |users|
   users.resource :account
   users.resources :roles
 end

Thanks

Matt
4c438a80fc30661ad619ea177cf9cbd0?d=identicon&s=25 Freddy Andersen (Guest)
on 2008-10-10 22:49
(Received via mailing list)
That does not look like the routes from restful authentication
alone... Looks like there is a role base authentication system added
too...

If you do all the user editing inside the admin space why not just
wrap this in the admin space?

map.resources :admin do |admin|
 admin.resources :users, :member => { :enable => :put } do |users|
   users.resource :account
   users.resources :roles
 end
end
8fa0f5c2bf8ad238baa4e20cb0360ebd?d=identicon&s=25 Matt Harrison (iwasinnamuknow)
on 2008-10-11 00:16
(Received via mailing list)
Freddy Andersen wrote:
> That does not look like the routes from restful authentication
> alone... Looks like there is a role base authentication system added
> too...

My bad, I forgot to mention I am using the recipies from the RA with
bells and whistles article I found, including email activation and
roles.

> If you do all the user editing inside the admin space why not just
> wrap this in the admin space?
>
> map.resources :admin do |admin|
>  admin.resources :users, :member => { :enable => :put } do |users|
>    users.resource :account
>    users.resources :roles
>  end
> end

That would be a nice way to do it, I think I have come up with pretty
much the same thing but I have tidied up the paths at the same time.

Thanks for the input, it showed me I haven't done something really silly
:D

Thanks

Matt
This topic is locked and can not be replied to.