Class: Locomotive::ContentTypesController

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

Instance Method Summary collapse

Methods included from ActionController::UrlHelpers

#current_site_public_url, #public_page_url, #switch_to_site_url

Methods included from ActionController::SectionHelpers

#sections

Methods included from 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



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

def create
  @content_type = current_site.content_types.create(params[:content_type])
  respond_with @content_type, :location => edit_content_type_url(@content_type._id)
end

#destroyObject



33
34
35
36
37
# File 'app/controllers/locomotive/content_types_controller.rb', line 33

def destroy
  @content_type = current_site.content_types.find(params[:id])
  @content_type.destroy
  respond_with @content_type, :location => pages_url
end

#editObject



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

def edit
  @content_type = current_site.content_types.find(params[:id])
  respond_with @content_type
end

#newObject



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

def new
  @content_type = current_site.content_types.new
  respond_with @content_type
end

#updateObject



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

def update
  @content_type = current_site.content_types.find(params[:id])
  @content_type.update_attributes(params[:content_type])
  respond_with @content_type, :location => edit_content_type_url(@content_type._id)
end