Romain Biard
2010-Nov-14 23:13 UTC
Authlogic and rails 3 : NameError in User sessionsController#new
Hi everybody, I''ve installed Authlogic on Rails 3 following the Railscast (http:// railscasts.com/episodes/160-authlogic), and the resources I was able to find on the web, but I''m facing a problem. Once I''ve generated the user_sessions controller and mapped the login and logout routes, I get an error if I try to load the login page : uninitialized constant UserSessionsController::UserSession app/controllers/user_sessions_controller.rb:11:in `new'' The user_sessions model is really simple : class UserSession < Authlogic::Session::Base end But it looks like this class declaration is not considered by Rails... Does anyone have an idea ? Thx by advance for your help. Romain -- 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.
Fidel Viegas
2010-Nov-15 10:39 UTC
Re: Authlogic and rails 3 : NameError in User sessionsController#new
On 11/15/10, Romain Biard <romain.biard-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi everybody, > > I''ve installed Authlogic on Rails 3 following the Railscast (http:// > railscasts.com/episodes/160-authlogic), and the resources I was able > to find on the web, but I''m facing a problem. > > Once I''ve generated the user_sessions controller and mapped the login > and logout routes, I get an error if I try to load the login page : > uninitialized constant UserSessionsController::UserSession > app/controllers/user_sessions_controller.rb:11:in `new'' > > The user_sessions model is really simple : > class UserSession < Authlogic::Session::Base > end > > But it looks like this class declaration is not considered by Rails... > > Does anyone have an idea ? > > Thx by advance for your help. > RomainHi Romain, Have a look at this link http://www.dixis.com/?p=352 on how to setup authlogic with rails 3. I have had a similar problem, and after following that tutorial, I managed to resolve my problem. I do get a few deprecation warnings, but overall it has been working ok. Hope that helps. Regards, Fidel. -- 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.
Frederick Cheung
2010-Nov-15 12:18 UTC
Re: Authlogic and rails 3 : NameError in User sessionsController#new
On Nov 14, 11:13 pm, Romain Biard <romain.bi...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi everybody, > > I''ve installed Authlogic on Rails 3 following the Railscast (http:// > railscasts.com/episodes/160-authlogic), and the resources I was able > to find on the web, but I''m facing a problem. > > Once I''ve generated the user_sessions controller and mapped the login > and logout routes, I get an error if I try to load the login page : > uninitialized constant UserSessionsController::UserSession > app/controllers/user_sessions_controller.rb:11:in `new'' > > The user_sessions model is really simple : > class UserSession < Authlogic::Session::Base > end > > But it looks like this class declaration is not considered by Rails... >Where is that file? is it in user_session.rb somewhere on the loadpath (not user_sessions.rb) Fred> Does anyone have an idea ? > > Thx by advance for your help. > Romain-- 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@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Romain Biard
2010-Nov-15 12:30 UTC
Re: Authlogic and rails 3 : NameError in User sessionsController#new
Thx Fidel, I''ll have a look at this tutorial. Romain On 15 nov, 11:39, Fidel Viegas <fidel.vie...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On 11/15/10, Romain Biard <romain.bi...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > > > > > > > Hi everybody, > > > I''ve installed Authlogic on Rails 3 following the Railscast (http:// > > railscasts.com/episodes/160-authlogic), and the resources I was able > > to find on the web, but I''m facing a problem. > > > Once I''ve generated the user_sessions controller and mapped the login > > and logout routes, I get an error if I try to load the login page : > > uninitialized constant UserSessionsController::UserSession > > app/controllers/user_sessions_controller.rb:11:in `new'' > > > The user_sessions model is really simple : > > class UserSession < Authlogic::Session::Base > > end > > > But it looks like this class declaration is not considered by Rails... > > > Does anyone have an idea ? > > > Thx by advance for your help. > > Romain > > Hi Romain, > > Have a look at this linkhttp://www.dixis.com/?p=352on how to setup > authlogic with rails 3. I have had a similar problem, and after > following that tutorial, I managed to resolve my problem. > > I do get a few deprecation warnings, but overall it has been working ok. > > Hope that helps. > > Regards, > > Fidel.-- 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.
Romain Biard
2010-Nov-15 12:32 UTC
Re: Authlogic and rails 3 : NameError in User sessionsController#new
Yes it is, but in my setup it is user_sessions.rb with an "s". It seems to me (but I''m a RoR newbie) that controller files should have an "s"... Can you tell me more on that ? Thx Romain On 15 nov, 13:18, Frederick Cheung <frederick.che...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On Nov 14, 11:13 pm, Romain Biard <romain.bi...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > > > > > Hi everybody, > > > I''ve installed Authlogic on Rails 3 following the Railscast (http:// > > railscasts.com/episodes/160-authlogic), and the resources I was able > > to find on the web, but I''m facing a problem. > > > Once I''ve generated the user_sessions controller and mapped the login > > and logout routes, I get an error if I try to load the login page : > > uninitialized constant UserSessionsController::UserSession > > app/controllers/user_sessions_controller.rb:11:in `new'' > > > The user_sessions model is really simple : > > class UserSession < Authlogic::Session::Base > > end > > > But it looks like this class declaration is not considered by Rails... > > Where is that file? is it in user_session.rb somewhere on the loadpath > (not user_sessions.rb) > > Fred > > > > > > > > > Does anyone have an idea ? > > > Thx by advance for your help. > > Romain-- 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@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Marnen Laibow-Koser
2010-Nov-15 14:35 UTC
Re: Authlogic and rails 3 : NameError in User sessionsController#new
Romain B. wrote in post #961546:> Yes it is, but in my setup it is user_sessions.rb with an "s". It > seems to me (but I''m a RoR newbie) that controller files should have > an "s"...They should. But this is a model, not a controller.> Can you tell me more on that ? > Thx > RomainBest, -- 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.