5

I installed authlogic and created a signup mechanism.And for creating a sign in mechanism I tried to generate the session controlers as below but rails 3 throws error as follows. How do I create the user_session and proceed with authlogic in rails 3 ?

:~/work_space/rails_apps/sample_authentication$ rails generate session user_session  
Could not find generator session  
Hemanth
  • 5,035
  • 9
  • 41
  • 59
  • Did you edit Authlogic to your gem file and do a bundle install? – Maran Oct 17 '10 at 09:53
  • 1
    Yeah i added the lines gem "authlogic" and gem "rails3-generators" in my Gemfile and did a bundle install.And was able to use up signup functionality of authlogic. – Hemanth Oct 17 '10 at 10:11
  • Also version of authlogic gem are you using ? – Rishav Rastogi Oct 17 '10 at 12:59
  • Using authlogic (2.1.6) Using bundler (1.0.0) Using thor (0.14.3) Using railties (3.0.0) Using rails (3.0.0) Using rails3-generators (0.14.0) – Hemanth Oct 17 '10 at 13:10
  • I also tried to manually add the model view and controller files that would be generated by the session generator script and when I try to test my app am getting the following error. Model UserSession does not respond to name Extracted source (around line #5): <% form_for :user_session, @user_session, :url => { :action => "create" } do |f| %>

    <%= f.label :name %>
    <%= f.text_field :name %> <<<< error points to this line

    <%= f.label :password %>

    – Hemanth Oct 17 '10 at 13:18

1 Answers1

1

as for the time being the generator for session still doesn't work with rails 3. However here

https://github.com/jonathandean/authlogic_example

the tutorial in the readme explains how to use authlogic (and generate a session-model) with rails 3. Basically all you have to do is to generate a normal model.

Lukas
  • 9,752
  • 15
  • 76
  • 120