Sha256: 40a62464fa3879af7c9938130b255bd5437611eca36bdd64b6711c7bbbc8cd6b

Contents?: true

Size: 1.49 KB

Versions: 11

Compression:

Stored size: 1.49 KB

Contents

module RailsConnector
  # This controller provides some default includes ({CmsAccessible}),
  # before filters (+load_object+, among others), and actions to simplify
  # CMS object handling. It should never be used directly, but only as a
  # super class to {CmsController}.
  # @api public
  class DefaultCmsController < ApplicationController
    include CmsAccessible
    before_action :load_object
    before_action :ensure_object_is_active
    before_action :ensure_object_is_permitted
    before_action :set_google_expire_header

    # Default Action. Delivers files directly if their mime type is not text/html
    # @api public
    def index
      deliver_file if @obj.mime_type != "text/html"
    end

    # Toggles edit markers. The current status is stored in the session.
    # @api public
    def toggle_editmarkers
      session[:hide_editmarkers] = !session[:hide_editmarkers]
      redirect_to cms_id_url(@obj)
    end

    # This method indicates if this controller should be used automatically when an Obj is
    # requested via the Rails Connector's standard routes. It returns true by default.
    #
    # Overwrite it to return false if you do want your controller to be excluded from Obj dispatching.
    #
    # You may also implement a method with the name {use_for_obj_dispatch?} in controllers not
    # descending from {DefaultCmsController} to include them in Obj dispatching.
    #
    # @see Obj#controller_name
    # @api public
    def self.use_for_obj_dispatch?
      true
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
infopark_fiona_connector-7.0.1.6.1.6.rc4 app/controllers/rails_connector/default_cms_controller.rb
infopark_fiona_connector-7.0.1.6.1.6.rc3 app/controllers/rails_connector/default_cms_controller.rb
infopark_fiona_connector-7.0.1.6.1.6.rc2 app/controllers/rails_connector/default_cms_controller.rb
infopark_fiona_connector-7.0.1.6.1.6.rc1 app/controllers/rails_connector/default_cms_controller.rb
infopark_fiona_connector-7.0.1.5.2.7.rc1 app/controllers/rails_connector/default_cms_controller.rb
infopark_fiona_connector-7.0.1.5.2.4.rc2 app/controllers/rails_connector/default_cms_controller.rb
infopark_fiona_connector-7.0.1.5.2.4.rc1 app/controllers/rails_connector/default_cms_controller.rb
infopark_fiona_connector-7.0.1.5.2.3.rc8 app/controllers/rails_connector/default_cms_controller.rb
infopark_fiona_connector-7.0.1.5.2.3.rc7 app/controllers/rails_connector/default_cms_controller.rb
infopark_fiona_connector-7.0.1.5.2.3.rc6 app/controllers/rails_connector/default_cms_controller.rb
infopark_fiona_connector-7.0.1.5.2.3.rc5 app/controllers/rails_connector/default_cms_controller.rb