So what to do:
1. Create your own
RegistrationsController which inherits from Devise::RegistrationsController and modify the update_sanitized_params with the value you want to pass (for example, name).class RegistrationsController < Devise::RegistrationsController
before_filter :update_sanitized_params, if: :devise_controller?
def update_sanitized_params
devise_parameter_sanitizer.for(:sign_up) {|u| u.permit(:name, :organization_name, :email, :password, :password_confirmation,
:name)}
end
end
2. Update the
routes.rb like so:devise_for :users, :controllers => { registrations: 'registrations' }
3. Update the
app/views/devise/registrations/new.html.erb form accordingly, so you can pass the name parameter.4. Do a little dance if the above works.
No comments :
Post a Comment