Sha256: 8313619755b3ce72f0cdf2b7b1d5eb98421bba237bc49aadc60fa60d76fb3213

Contents?: true

Size: 1.1 KB

Versions: 18

Compression:

Stored size: 1.1 KB

Contents

module Locomotive
  class ContentTypesController < BaseController

    sections 'contents'

    before_filter :back_to_default_site_locale, only: %w(new create)

    respond_to :json, only: [:create, :update, :destroy]

    helper 'Locomotive::Accounts', 'Locomotive::CustomFields'

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

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

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

    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_path(@content_type._id)
    end

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

  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
locomotive_cms-2.5.7 app/controllers/locomotive/content_types_controller.rb
locomotive_cms-2.5.6 app/controllers/locomotive/content_types_controller.rb
locomotive_cms-2.5.6.rc2 app/controllers/locomotive/content_types_controller.rb
locomotive_cms-2.5.6.rc1 app/controllers/locomotive/content_types_controller.rb
locomotive_cms-2.5.5 app/controllers/locomotive/content_types_controller.rb
locomotive_cms-2.5.4 app/controllers/locomotive/content_types_controller.rb
locomotive_cms-2.5.3 app/controllers/locomotive/content_types_controller.rb
locomotive_cms-2.5.2 app/controllers/locomotive/content_types_controller.rb
locomotive_cms-2.5.1 app/controllers/locomotive/content_types_controller.rb
locomotive_cms-2.5.0 app/controllers/locomotive/content_types_controller.rb
locomotive_cms-2.5.0.rc3 app/controllers/locomotive/content_types_controller.rb
locomotive_cms-2.5.0.rc2 app/controllers/locomotive/content_types_controller.rb
locomotive_cms-2.5.0.rc1 app/controllers/locomotive/content_types_controller.rb
locomotive_cms-2.4.1 app/controllers/locomotive/content_types_controller.rb
locomotive_cms-2.4.0 app/controllers/locomotive/content_types_controller.rb
locomotive_cms-2.3.1 app/controllers/locomotive/content_types_controller.rb
locomotive_cms-2.3.0 app/controllers/locomotive/content_types_controller.rb
locomotive_cms-2.2.3 app/controllers/locomotive/content_types_controller.rb