Very new to working with rails. I have implemented a basic login system using Devise. I am trying to add a couple of new fields (bio:string, name:string) into the sign_up pa
Here's another straight forward way that works in my rails 4.2.1 app:
Create the following file
/config/initializers/devise_permitted_parameters.rb
and the code..
module DevisePermittedParameters
extend ActiveSupport::Concern
included do
before_filter :configure_permitted_parameters
end
protected
def configure_permitted_parameters
devise_parameter_sanitizer.for(:sign_up) << :name
devise_parameter_sanitizer.for(:account_update) << :name
devise_parameter_sanitizer.for(:sign_up) << :bio
devise_parameter_sanitizer.for(:account_update) << :bio
end
end
DeviseController.send :include, DevisePermittedParameters