Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Strong parameters with devise
class ApplicationController < ActionController::Base
before_filter :define_resource_params, if: :devise_controller?
protected
def define_resource_params
if ((self.class <= Devise::PasswordsController) || (self.class <= Devise::RegistrationsController))
self.class.send(:define_method, :resource_params) do
params.require(resource_name).permit(:email, :password, :password_confirmation)
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment