Created
April 17, 2012 15:06
-
-
Save mattslay/2406616 to your computer and use it in GitHub Desktop.
Devise_Admin_Create_User_Account
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# When you do not want Users to be able to sign up for your site, rather, you want the admin to create the account and send them the login info. | |
class User < ActiveRecord::Base | |
def self.create_new_user(email, password) | |
user = User.new({ :email => email, :password => password }) | |
return user.save | |
end | |
end | |
# This requires the admin to choose a password, so you could create a an algorithm to create | |
# a random 10-character string and email it to the user with the invite. The user can change that if they want. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment