Class: Subscribem::AccountsController

Inherits:
ApplicationController show all
Defined in:
app/controllers/subscribem/accounts_controller.rb

Instance Method Summary collapse

Methods inherited from ApplicationController

#authenticate_user!, #current_account, #current_user, #force_authentication!, #user_signed_in?

Instance Method Details

#createObject



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()
  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

#newObject



6
7
8
9
# File 'app/controllers/subscribem/accounts_controller.rb', line 6

def new
  @account = Subscribem::Account.new
  @account.build_owner
end