Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- undefined method `for' for #<Devise::ParameterSanitizer:0x007fe4c2821988> Did you mean? fork
- }
- elsif params[:action] == 'create'
- devise_parameter_sanitizer.for(:sign_up) {
- |u| u.permit(registration_params)
- }
- end
- class ApplicationController < ActionController::Base
- protect_from_forgery with: :exception
- before_action :configure_devise_permitted_parameters, if: :devise_controller?
- protected
- def configure_devise_permitted_parameters
- registration_params = [:first_name,:last_name, :address,:gender, :DOB, :email, :password, :password_confirmation, :image, :thumb, :medium]
- if params[:action] == 'update'
- devise_parameter_sanitizer.for(:account_update) {
- |u| u.permit(registration_params << :current_password)
- }
- elsif params[:action] == 'create'
- devise_parameter_sanitizer.for(:sign_up) {
- |u| u.permit(registration_params)
- }
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement