cmckni3
9/21/2012 - 7:29 AM

StrongParameters with Devise

StrongParameters with Devise

# config/routes.rb

devise_for :users, :controllers => {:registrations => "users/registrations", :passwords => "users/passwords"}
# app/controllers/users/registrations_controller.rb

class Users::RegistrationsController < Devise::RegistrationsController
  def resource_params
    params.require(:user).permit(:name, :email, :password, :password_confirmation)
  end
  private :resource_params
end
# app/controllers/users/password_controller.rb

class Users::PasswordsController < Devise::PasswordsController
  def resource_params
    params.require(:user).permit(:email, :password, :password_confirmation)
  end
  private :resource_params
end