password generation

This commit is contained in:
2016-09-28 22:39:42 -05:00
parent 2a10a93ac9
commit 7d7e040c2b
5 changed files with 20 additions and 2 deletions

View File

@ -10,7 +10,7 @@ class AccountsController < ApplicationController
end
def new
@account = Account.new
@account = Account.new(password: SecureRandom.urlsafe_base64(12))
end
def edit
@ -20,6 +20,10 @@ class AccountsController < ApplicationController
render json: { hash: @account.password }.to_json
end
def genpass
render json: { hash: SecureRandom.urlsafe_base64(12) }.to_json
end
def create
@account = Account.new(account_params)