Skip to content

Commit

Permalink
set autofocus only once for many authentication_keys fields in sessio…
Browse files Browse the repository at this point in the history
…n/new view
  • Loading branch information
timoschilling committed Jul 9, 2014
1 parent 2ae0a9e commit 0c38f0c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/views/active_admin/devise/sessions/new.html.erb
Expand Up @@ -4,8 +4,8 @@
<% scope = Devise::Mapping.find_scope!(resource_name) %>
<%= active_admin_form_for(resource, :as => resource_name, :url => send(:"#{scope}_session_path"), :html => { :id => "session_new" }) do |f|
f.inputs do
resource.class.authentication_keys.each { |key|
f.input key, :label => t('active_admin.devise.'+key.to_s+'.title'), :input_html => {:autofocus => true}
resource.class.authentication_keys.each_with_index { |key, index|
f.input key, :label => t('active_admin.devise.'+key.to_s+'.title'), :input_html => {:autofocus => index.zero?}
}
f.input :password, :label => t('active_admin.devise.password.title')
f.input :remember_me, :label => t('active_admin.devise.login.remember_me'), :as => :boolean if devise_mapping.rememberable?
Expand Down

0 comments on commit 0c38f0c

Please sign in to comment.