app/controllers/sign_ups_controller.rb
# We `remove_year_from_params` on all actions except create.
# This allows us to leave user.year attr_accessible, which is very
# helpful during the create action.  This implementation (deleting
# the param) is much easier than completely re-writing
# Devise::RegistrationsController.create()
We `remove_year_from_params` on all actions except create.
This allows us to leave user.year attr_accessible, which is very
helpful during the create action.  This implementation (deleting
the param) is much easier than completely re-writing
Devise::RegistrationsController.create()
We ` remove_year_from_params ` on all actions except create . This allows us to leave user . year attr_accessible which is very helpful during the create action . This implementation ( deleting the param ) is much easier than completely re - writing Devise :: RegistrationsController . create ()
def remove_year_from_params
    if params_contains_user_attr :year
      Rails.logger.warn "WARNING: Removing protected attribute: year"
      params[:user].delete :year
    end
  end
def remove_year_from_params if params_contains_user_attr :year Rails . logger . warn "WARNING: Removing protected attribute: year" params [ :user ] . delete :year end end
We `remove_year_from_params` on all actions except create.
We ` remove_year_from_params ` on all actions except create .