Skip to content

Instantly share code, notes, and snippets.

@dotemacs
Created October 4, 2009 13:18
Show Gist options
  • Save dotemacs/201379 to your computer and use it in GitHub Desktop.
Save dotemacs/201379 to your computer and use it in GitHub Desktop.
# basing it on this:
# http://github.com/binarylogic/authlogic_example/blob/master/app/views/user_sessions/new.html.erb
<h1>Login</h1>
<% form_for @user_session, :url => user_session_path do |f| %>
<%= f.error_messages %>
<%= f.label :login %><br />
<%= f.text_field :login %><br />
<br />
# the following two lines are extra
<%= f.label :email %><br />
<%= f.text_field :email %><br/>
<%= f.label :password %><br />
<%= f.password_field :password %><br />
<br />
<%= f.check_box :remember_me %><%= f.label :remember_me %><br />
<br />
<%= f.submit "Login" %>
<% end %>
# then when I try to use it I get:
undefined method `email' for #<UserSession: no credentials provided>
# my user model has the 'email' column
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment