I've tried everything I can find, including what is in the Devise README (https://github.com/plataformatec/devise#strong-parameters), this more descriptive take on the README (http://blog.12spokes.com/web-design-development/adding-custom-fields-to-your-devise-user-model-in-rails-4/comment-page-1/#comment-26217), and every answer I find on StackOverflow seems consistent with these 2 solutions. All these solutions result in the same error: 2 errors prohibited this user from being saved: - Email can't be blank - Password can't be blank
I also tried including gem 'protected_attributes' in the gemfile and running bundle so that I could use attr_accessible rather than strong parameters. With this approach, it appeared that I was able to save the user okay, but none of my fields, custom or otherwise, actually persisted. They all remained nil. I also tried reverting devise back to a previous version where attr_accessible was used rather than strong parameters and that resulted in the same issue where nothing persisted.
I'm at a complete standstill with this at the moment so any ideas on other solutions that may work would be greatly appreciated... Thanks in advance!
EDIT: Here's my application controller:
class ApplicationController < ActionController::Base
before_filter :configure_permitted_parameters, if: :devise_controller?
protected
def configure_permitted_parameters
devise_parameter_sanitizer.for(:sign_in) { |u| u.permit(:profile_name, :email, :password) }
devise_parameter_sanitizer.for(:sign_up) { |u| u.permit(:first_name, :last_name, :profile_name, :email, :password, :password_confirmation) }
devise_parameter_sanitizer.for(:account_update) { |u| u.permit(:first_name, :last_name, :profile_name, :email, :password, :password_confirmation, :current_password) }
end
# Prevent CSRF attacks by raising an exception.
# For APIs, you may want to use :null_session instead.
protect_from_forgery with: :exception
end