Skip to content

Instantly share code, notes, and snippets.

@avsej
Created October 31, 2012 11:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save avsej/3986579 to your computer and use it in GitHub Desktop.
Save avsej/3986579 to your computer and use it in GitHub Desktop.
class RegistrationsController < Devise::RegistrationsController
def show
github_name = params[:github_name]
if User.find_by_username(github_name)
redirect_to new_user_session_url, :notice => t(:already_registered)
else
session[:github_name] = github_name
@user = User.new(:username => github_name)
if @user.create_for_session_data
flash[:notice] = t(:email_sent, :email => @user.params_for_account['email'])
end
render 'show'
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment