Class: Locomotive::SitesController
Instance Method Summary
collapse
#require_ssl
#current_site_public_url, #public_page_url, #switch_to_site_url
#sections
#back_to_default_site_locale, #current_content_locale, #localized?, #set_back_office_locale, #set_current_content_locale, #setup_i18n_fallbacks
Instance Method Details
#create ⇒ Object
13
14
15
16
17
18
|
# File 'app/controllers/locomotive/sites_controller.rb', line 13
def create
@site = Site.new(params[:site])
@site.memberships.build account: self.current_locomotive_account, role: 'admin'
@site.save
respond_with @site, location: edit_my_account_path
end
|
#destroy ⇒ Object
20
21
22
23
24
25
26
27
28
29
30
|
# File 'app/controllers/locomotive/sites_controller.rb', line 20
def destroy
@site = self.current_locomotive_account.sites.find(params[:id])
if @site != current_site
@site.destroy
else
@site.errors.add(:base, 'Can not destroy the site you are logging in now')
end
respond_with @site, location: edit_my_account_path
end
|
#new ⇒ Object
8
9
10
11
|
# File 'app/controllers/locomotive/sites_controller.rb', line 8
def new
@site = Site.new
respond_with @site
end
|