Class: DomainsController
Instance Method Summary
collapse
#active_tab
#sshkey_uploaded?
#domain_is_missing, #user_default_domain
#user_capabilities
Instance Method Details
#create ⇒ Object
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 account_path, :flash => {:success => 'Your domain has been created'}
else
render :new
end
end
|
#edit ⇒ Object
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
|
#new ⇒ Object
2
3
4
|
# File 'app/controllers/domains_controller.rb', line 2
def new
@domain = Domain.new
end
|
#update ⇒ Object
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 account_path, :flash => {:success => 'Your domain has been changed. Your public URLs will now be different'}
else
render :edit
end
end
|