I have fixed the problem overriding the create
method from this doc:
If you want add specify column or field locale
on your model user with strong parameters gem
, you can add to controllers/users/registrations_controller.rb
the next:
class Users::RegistrationsController < Devise::RegistrationsController
def create
build_resource
resource.locale = set_locale #set_locale or where you have stored your own locale
if resource.save
if resource.active_for_authentication?
set_flash_message :notice, :signed_up if is_navigational_format?
sign_up(resource_name, resource)
respond_with resource, :location => after_sign_up_path_for(resource)
else
set_flash_message :notice, :"signed_up_but_#{resource.inactive_message}" if is_navigational_format?
expire_session_data_after_sign_in!
respond_with resource, :location => after_inactive_sign_up_path_for(resource)
end
else
clean_up_passwords resource
respond_with resource
end
end
def resource_params
params.require(:user).permit(:username, :email, :password, :password_confirmation, :locale)
end
private :resource_params
end
Regards!