Class: Locomotive::Api::ContentEntriesController
- Inherits:
-
BaseController
- Object
- ApplicationController
- BaseController
- Locomotive::Api::ContentEntriesController
show all
- Defined in:
- app/controllers/locomotive/api/content_entries_controller.rb
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
21
22
23
24
25
|
# File 'app/controllers/locomotive/api/content_entries_controller.rb', line 21
def create
@content_entry.from_presenter(params[:content_entry] || params[:entry])
@content_entry.save
respond_with @content_entry, location: main_app.locomotive_api_content_entries_url(@content_type.slug)
end
|
#destroy ⇒ Object
33
34
35
36
|
# File 'app/controllers/locomotive/api/content_entries_controller.rb', line 33
def destroy
@content_entry.destroy
respond_with @content_entry, location: main_app.locomotive_api_content_entries_url(@content_type.slug)
end
|
#index ⇒ Object
12
13
14
15
|
# File 'app/controllers/locomotive/api/content_entries_controller.rb', line 12
def index
@content_entries = @content_entries.order_by([get_content_type.order_by_definition])
respond_with @content_entries
end
|
#show ⇒ Object
17
18
19
|
# File 'app/controllers/locomotive/api/content_entries_controller.rb', line 17
def show
respond_with @content_entry, status: @content_entry ? :ok : :not_found
end
|
#update ⇒ Object
27
28
29
30
31
|
# File 'app/controllers/locomotive/api/content_entries_controller.rb', line 27
def update
@content_entry.from_presenter(params[:content_entry] || params[:entry])
@content_entry.save
respond_with @content_entry, location: main_app.locomotive_api_content_entries_url(@content_type.slug)
end
|