ok, so more on this.
I can say "I forgot my password", have the reset password email sent,
and change the password. It will then log me in. If I click "logout",
then "login" and use that password, it will fail.
Here is my sessions controller:
class SessionsController < Devise::SessionsController
before_filter :load_ads, :only => [:new]
protected
def load_ads
@ads = Advertiser.order("RAND()").limit(2)
end
end
my routes contain
devise_for :users, :controllers => { :sessions => :sessions,
:registrations => :users } do
get '/login' => 'sessions#new', :as => :login
get '/logout' => 'sessions#destroy', :as => :logout
end
Here is my login form
<%= form_for("user", :url => user_session_path) do |f| %>
<div class="field">
<%= f.label(:email, :class => 'label') %><br />
<%= f.text_field(:email) %>
</div>
<div class="field">
<%= f.label(:password, :class => 'label') %>
<%= f.password_field(:password) %>
</div>
<div class="field">
<%= f.check_box :remember_me %>
<%= f.label :remember_me %>
<p><%= f.submit('Sign in') %></p>
</div>
<br clear="all" />
<% end %>
--
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@googlegroups.com.
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.
No comments:
Post a Comment