Class: Locomotive::Api::SitesController
Instance Method Summary
collapse
#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
22
23
24
25
26
27
|
# File 'app/controllers/locomotive/api/sites_controller.rb', line 22
def create
@site.from_presenter(params[:site])
@site.memberships.build account: self.current_locomotive_account, role: 'admin'
@site.save
respond_with(@site)
end
|
#destroy ⇒ Object
35
36
37
38
|
# File 'app/controllers/locomotive/api/sites_controller.rb', line 35
def destroy
@site.destroy
respond_with(@site)
end
|
#index ⇒ Object
13
14
15
16
|
# File 'app/controllers/locomotive/api/sites_controller.rb', line 13
def index
@sites = self.current_locomotive_account.sites.all
respond_with(@sites)
end
|
#show ⇒ Object
18
19
20
|
# File 'app/controllers/locomotive/api/sites_controller.rb', line 18
def show
respond_with(@site)
end
|
#update ⇒ Object
29
30
31
32
33
|
# File 'app/controllers/locomotive/api/sites_controller.rb', line 29
def update
@site.from_presenter(params[:site])
@site.save
respond_with @site
end
|