Class: Subscribem::AccountsController
Instance Method Summary
collapse
#authenticate_user!, #current_account, #current_user, #force_authentication!, #user_signed_in?
Instance Method Details
#create ⇒ Object
11
12
13
14
15
16
17
18
19
20
21
|
# File 'app/controllers/subscribem/accounts_controller.rb', line 11
def create
@account = Subscribem::Account.create_with_owner(account_params)
if @account.valid?
force_authentication!(@account, @account.owner)
flash[:success] = "Your account has been successfully created."
redirect_to subscribem.root_url(:subdomain => @account.subdomain)
else
flash[:error] = "Sorry, your account could not be created."
render :new
end
end
|
#new ⇒ Object
6
7
8
9
|
# File 'app/controllers/subscribem/accounts_controller.rb', line 6
def new
@account = Subscribem::Account.new
@account.build_owner
end
|