Class: Locomotive::Api::ContentTypesController
- Inherits:
-
BaseController
- Object
- ApplicationController
- BaseController
- Locomotive::Api::ContentTypesController
show all
- Defined in:
- app/controllers/locomotive/api/content_types_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
17
18
19
20
21
22
|
# File 'app/controllers/locomotive/api/content_types_controller.rb', line 17
def create
@content_type = current_site.content_types.new
@content_type.from_presenter(params[:content_type])
@content_type.save
respond_with @content_type, :location => main_app.locomotive_api_content_types_url
end
|
#destroy ⇒ Object
31
32
33
34
35
|
# File 'app/controllers/locomotive/api/content_types_controller.rb', line 31
def destroy
@content_type = current_site.content_types.find(params[:id])
@content_type.destroy
respond_with @content_type
end
|
#index ⇒ Object
7
8
9
10
|
# File 'app/controllers/locomotive/api/content_types_controller.rb', line 7
def index
@content_types = current_site.content_types.order_by([[:name, :asc]])
respond_with(@content_types)
end
|
#show ⇒ Object
12
13
14
15
|
# File 'app/controllers/locomotive/api/content_types_controller.rb', line 12
def show
@content_type = current_site.content_types.find(params[:id])
respond_with @content_type
end
|
#update ⇒ Object
24
25
26
27
28
29
|
# File 'app/controllers/locomotive/api/content_types_controller.rb', line 24
def update
@content_type = current_site.content_types.find(params[:id])
@content_type.from_presenter(params[:content_type])
@content_type.save
respond_with @content_type, :location => main_app.locomotive_api_content_types_url
end
|