magick encoding

This commit is contained in:
Nico 2013-01-09 00:16:23 +01:00
parent 2e22001662
commit 6947f1aaea
2 changed files with 3 additions and 12 deletions

View File

@ -13,13 +13,4 @@ class Admin < ActiveRecord::Base
# attr_accessible :title, :body # attr_accessible :title, :body
protected
def self.find_for_database_authentication(warden_conditions)
conditions = warden_conditions.dup
login = conditions.delete(:login)
where(conditions).where(["username = :value OR email = :value", { :value => login }]).first
end
end end

View File

@ -1,8 +1,8 @@
<h2>Sign in</h2> <h2>Sign in</h2>
<%= form_for(resource, :as => resource_name, :url => session_path(resource_name)) do |f| %> <%= form_for(resource, :as => resource_name, :url => session_path(resource_name)) do |f| %>
<div><%= f.label :login %><br /> <div><%= f.label :username %><br />
<%= f.text_field :login %></div> <%= f.text_field :username %></div>
<div><%= f.label :password %><br /> <div><%= f.label :password %><br />
<%= f.password_field :password %></div> <%= f.password_field :password %></div>