Class: DomainsController

Inherits:
ConsoleController show all
Defined in:
app/controllers/domains_controller.rb

Instance Method Summary collapse

Methods inherited from ConsoleController

#active_tab

Methods included from SshkeyAware

#sshkey_uploaded?

Methods included from DomainAware

#domain_is_missing, #user_default_domain

Methods included from CapabilityAware

#user_capabilities

Instance Method Details

#createObject



6
7
8
9
10
11
12
13
14
15
# File 'app/controllers/domains_controller.rb', line 6

def create
  @domain = Domain.new params[:domain]
  @domain.as = current_user

  if @domain.save
    redirect_to , :flash => {:success => 'Your domain has been created'}
  else
    render :new
  end
end

#editObject



17
18
19
# File 'app/controllers/domains_controller.rb', line 17

def edit
  @domain = Domain.find(:one, :as => current_user) rescue redirect_to(new_domain_path)
end

#newObject



2
3
4
# File 'app/controllers/domains_controller.rb', line 2

def new
  @domain = Domain.new
end

#updateObject



21
22
23
24
25
26
27
28
29
# File 'app/controllers/domains_controller.rb', line 21

def update
  @domain = Domain.find(:one, :as => current_user)
  @domain.attributes = params[:domain]
  if @domain.save
    redirect_to , :flash => {:success => 'Your domain has been changed.  Your public URLs will now be different'}
  else
    render :edit
  end
end