Class: Locomotive::Api::ContentTypesController

Inherits:
BaseController
  • Object
show all
Defined in:
app/controllers/locomotive/api/content_types_controller.rb

Instance Method Summary collapse

Methods included from Locomotive::ActionController::LocaleHelpers

#back_to_default_site_locale, #current_content_locale, #localized?, #set_back_office_locale, #set_current_content_locale, #setup_i18n_fallbacks

Instance Method Details

#createObject



16
17
18
19
20
# File 'app/controllers/locomotive/api/content_types_controller.rb', line 16

def create
  @content_type.from_presenter(params[:content_type])
  @content_type.save
  respond_with @content_type, location: main_app.locomotive_api_content_types_url
end

#destroyObject



28
29
30
31
# File 'app/controllers/locomotive/api/content_types_controller.rb', line 28

def destroy
  @content_type.destroy
  respond_with @content_type
end

#indexObject



7
8
9
10
# File 'app/controllers/locomotive/api/content_types_controller.rb', line 7

def index
  @content_types = @content_types.order_by(:name.asc)
  respond_with(@content_types)
end

#showObject



12
13
14
# File 'app/controllers/locomotive/api/content_types_controller.rb', line 12

def show
  respond_with @content_type
end

#updateObject



22
23
24
25
26
# File 'app/controllers/locomotive/api/content_types_controller.rb', line 22

def update
  @content_type.from_presenter(params[:content_type])
  @content_type.save
  respond_with @content_type, location: main_app.locomotive_api_content_types_url
end