Skip to content

Instantly share code, notes, and snippets.

@revans
Last active August 29, 2015 14:14
Show Gist options
  • Save revans/7a22e5da6dd55d4ac97f to your computer and use it in GitHub Desktop.
Save revans/7a22e5da6dd55d4ac97f to your computer and use it in GitHub Desktop.
Strong Params
class UserController < ApplicationController
def create
@user = User.new(user_params)
respond_to do |format|
if @user.save
...
else
...
end
end
end
private
def user_params
params.require(:user).permit(
:name, :email, :password, :password_confirmation
)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment