Skip to content

Instantly share code, notes, and snippets.

@Znow
Created March 26, 2011 10:56
Show Gist options
  • Select an option

  • Save Znow/888199 to your computer and use it in GitHub Desktop.

Select an option

Save Znow/888199 to your computer and use it in GitHub Desktop.
def create
@user = User.new(params[:user])
if signed_in?
flash[:error] = "You cannot create a user while signed in"
redirect_to @user
else
if @user.save
sign_in @user
flash[:success] = "Welcome to DanielG.dk!"
redirect_to @user # Redirects to the new users show page
else
@title = "Sign Up"
render 'new'
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment