I removed email field from my devise mapping, so now it is authenticated via "login"
Now when authentication succeeded and I'm being redirected to rails_admin dashboard, I get the following:
Showing C:/Ruby192/lib/ruby/gems/1.9.1/bundler/gems/rails_admin-8a247378542d/app/views/layouts/rails_admin/_header.html.haml where line #12 raised:
undefined method `email' for #Admin:0x45364c8
Extracted source (around line #12):
9: - if _current_user
10: - if authorized?(:edit, _current_user.class, _current_user)
11: %li= link_to header_icon(:account, _current_user.email), edit_path(_current_user.class.name.underscore.pluralize, _current_user)
12: - if defined?(Devise)
13: %li= link_to header_icon(:logout, t('admin.credentials.log_out')), main_app.url_for(:action => 'destroy', :controller => 'devise/sessions'), :method => Devise.sign_out_via
Which is obvious, since email field is missing :)
For now I just added dummy email field to my model, but should it be somehow more beautiful, isn't it?
_current_user.try :email is the answer. Think you could make a pull request?
Work if devise mapping does not have email field. Closes #734.
Need to check that _current_user responds_to :email. For #734.
3rd time lucky for #734 fix.