Reputation: 3169
autofill on Chrome on iOs is not working when there is <input name="user[email]"/>
, only when there is <input name="email"/>
Is there a way to post { email: 'xx' }, instead of { user: { email: 'xx' } } with devise?
So I tried to generate Users::SessionsController < Devise::SessionsController
in order to understand https://github.com/plataformatec/devise/blob/master/app/controllers/devise/sessions_controller.rb (def create
) but I couldn't. I think I have to modify one or two lines on sessionscontroller#create but I don't understand warden.authenticate!
I think this is what warden call 'default_scope', I tried auth_option.merge({scope: :default})
but not working
maybe modifying devise_parameter_sanitizer
, something like .merge({user:{email:params[:email], password:params[:password]})
, i don't know
🤔
Upvotes: 1
Views: 384
Reputation: 5528
You can user the autocomplete: "email"
option in the field.
e.g. in SimpleForm:
<%=f.input :email, input_html: { autocomplete: 'email' } %>
Upvotes: 2