Skip to content

Instantly share code, notes, and snippets.

@eduardopoleo
Last active September 14, 2016 21:23
Show Gist options
  • Select an option

  • Save eduardopoleo/62db59dcd1899b324933a31e4503049c to your computer and use it in GitHub Desktop.

Select an option

Save eduardopoleo/62db59dcd1899b324933a31e4503049c to your computer and use it in GitHub Desktop.
class UsersController < ApplicationController
def create
@user = User.new(user_params)
if @user.save
flash[:success] = "Welcome to Monchitos. Hope you enjoy it!"
redirect_to posts_path
else
flash[:error] = "Sorry your registration could not be completed"
render :new
end
end
private
def user_params
params.require(:user).permit(:email, :name, :user_name)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment