Sha256: eb3af391ac90258434cfbb4091ef6b15e865f9f49803b3f545f1fe770fbf910a

Contents?: true

Size: 1.52 KB

Versions: 24

Compression:

Stored size: 1.52 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_filter :set_preview_time
    before_filter :load_object
    before_filter :ensure_object_is_active
    before_filter :ensure_object_is_permitted
    before_filter :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

24 entries across 24 versions & 1 rubygems

Version Path
infopark_rails_connector-6.9.1.3.22208381 app/controllers/rails_connector/default_cms_controller.rb
infopark_rails_connector-6.9.0.3.197272233 app/controllers/rails_connector/default_cms_controller.rb
infopark_rails_connector-6.8.3.174.51542603 app/controllers/rails_connector/default_cms_controller.rb
infopark_rails_connector-6.8.3.115.227021242 app/controllers/rails_connector/default_cms_controller.rb
infopark_rails_connector-6.8.3.73.75172665 app/controllers/rails_connector/default_cms_controller.rb
infopark_rails_connector-6.8.3.2.153416031 app/controllers/rails_connector/default_cms_controller.rb
infopark_rails_connector-6.8.3.67.110847540 app/controllers/rails_connector/default_cms_controller.rb
infopark_rails_connector-6.8.3.1.23895778 app/controllers/rails_connector/default_cms_controller.rb
infopark_rails_connector-6.8.2.36.82613853 app/controllers/rails_connector/default_cms_controller.rb
infopark_rails_connector-6.8.2.7.128454143 app/controllers/rails_connector/default_cms_controller.rb
infopark_rails_connector-6.8.1.26.236500544 app/controllers/rails_connector/default_cms_controller.rb
infopark_rails_connector-6.8.1 app/controllers/rails_connector/default_cms_controller.rb
infopark_rails_connector-6.8.0.539.93842523 app/controllers/rails_connector/default_cms_controller.rb
infopark_rails_connector-6.8.0.529.114081979 app/controllers/rails_connector/default_cms_controller.rb
infopark_rails_connector-6.8.0.518.30999728 app/controllers/rails_connector/default_cms_controller.rb
infopark_rails_connector-6.8.0.515.34928522 app/controllers/rails_connector/default_cms_controller.rb
infopark_rails_connector-6.8.0.498.46559598 app/controllers/rails_connector/default_cms_controller.rb
infopark_rails_connector-6.8.0.480.261594408 app/controllers/rails_connector/default_cms_controller.rb
infopark_rails_connector-6.8.0.444.171626367 app/controllers/rails_connector/default_cms_controller.rb
infopark_rails_connector-6.8.0.406.131718077 app/controllers/rails_connector/default_cms_controller.rb