Class: Locomotive::Api::PagesController
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
16
17
18
19
20
|
# File 'app/controllers/locomotive/api/pages_controller.rb', line 16
def create
@page.from_presenter(params[:page])
@page.save
respond_with @page, location: main_app.locomotive_api_pages_url
end
|
#destroy ⇒ Object
28
29
30
31
|
# File 'app/controllers/locomotive/api/pages_controller.rb', line 28
def destroy
@page.destroy
respond_with @page
end
|
#index ⇒ Object
7
8
9
10
|
# File 'app/controllers/locomotive/api/pages_controller.rb', line 7
def index
@pages = @pages.order_by(:depth.asc, :position.asc)
respond_with(@pages)
end
|
#show ⇒ Object
12
13
14
|
# File 'app/controllers/locomotive/api/pages_controller.rb', line 12
def show
respond_with(@page)
end
|
#update ⇒ Object
22
23
24
25
26
|
# File 'app/controllers/locomotive/api/pages_controller.rb', line 22
def update
@page.from_presenter(params[:page])
@page.save
respond_with @page, location: main_app.locomotive_api_pages_url
end
|