lucky in ruby
2010-Aug-18 11:28 UTC
How to use restful_authentication for nested resources in Ra
I have a nested resource hotel_user and i wish to have hotel_users_controller under hotel namespace. I want to use restful authentication here and I want hotel_users_controller, sessions_controller in hotel directory like hotel/hotel_users_controller and hotel/sessions_controller. I tried with the following command in terminal and it failed. script/generate authenticated hotel_user hotel/session and it failed with the error The name ''AuthenticatedSystem'' is either already used in your application or reserved by Ruby on Rails.Please choose an alternative and run this generator again. The authenticated_system.rb file exists for some other resource under lib directory and not for hotel_user. the generator is seeing it and fails the generation of files. what can I do? please help -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Marnen Laibow-Koser
2010-Aug-18 13:49 UTC
Re: How to use restful_authentication for nested resources in Ra
lucky in ruby wrote:> I have a nested resource hotel_user and i wish to have > hotel_users_controller under hotel namespace. > > I want to use restful authentication here[...] No you don''t. restful_authentication should never be used: it relies too much on unmaintainable generated code that takes over your User model. It was OK when better alternatives didn''t exist, but they do now. Use Authlogic or something else reasonable. Best, -- Marnen Laibow-Koser http://www.marnen.org marnen-sbuyVjPbboAdnm+yROfE0A@public.gmane.org -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Robert Walker
2010-Aug-18 14:11 UTC
Re: How to use restful_authentication for nested resources in Ra
Marnen Laibow-Koser wrote:> lucky in ruby wrote: >> I have a nested resource hotel_user and i wish to have >> hotel_users_controller under hotel namespace. >> >> I want to use restful authentication here > [...] > > No you don''t. restful_authentication should never be used: it relies > too much on unmaintainable generated code that takes over your User > model. It was OK when better alternatives didn''t exist, but they do > now. Use Authlogic or something else reasonable.Besides your choice of authentication systems, it also sounds to me like you may be confusing authentication and authorization. If you want to add some sort of role based authorization then take a look at one of the authorization gems/plugins such as CanCan. http://github.com/ryanb/cancan I could be misunderstanding your needs. If so then just ignore this comment. -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
lucky in ruby
2010-Aug-18 15:16 UTC
Re: How to use restful_authentication for nested resources in Ra
Marnen Laibow-Koser wrote:> lucky in ruby wrote: >> I have a nested resource hotel_user and i wish to have >> hotel_users_controller under hotel namespace. >> >> I want to use restful authentication here > [...] > > No you don''t. restful_authentication should never be used: it relies > too much on unmaintainable generated code that takes over your User > model. It was OK when better alternatives didn''t exist, but they do > now. Use Authlogic or something else reasonable. > > Best, > -- > Marnen Laibow-Koser > http://www.marnen.org > marnen-sbuyVjPbboAdnm+yROfE0A@public.gmane.orgThank you. I will use authlogic. I have just entered rails horizon and thank you so much for the recommendation. -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.