Sha256: 828a9e11b5d86a83dcf73b78f2fea8e2ca434861cab2da945e66f93c82d43f38

Contents?: true

Size: 764 Bytes

Versions: 9

Compression:

Stored size: 764 Bytes

Contents

module Alchemy
  class ElementsController < Alchemy::BaseController
    load_and_authorize_resource
    layout false

    rescue_from CanCan::AccessDenied do |exception|
      raise ActiveRecord::RecordNotFound
    end

    # == Renders the element view partial
    #
    # === Accepted Formats
    #
    # * html
    # * js (Tries to replace a given +container_id+ with the elements view partial content via jQuery.)
    # * json (A JSON object that includes all contents and their ingredients)
    #
    def show
      @page = @element.page
      @options = params[:options]

      respond_to do |format|
        format.html
        format.js   { @container_id = params[:container_id] }
        format.json { render json: @element }
      end
    end

  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
alchemy_cms-3.0.4 app/controllers/alchemy/elements_controller.rb
alchemy_cms-3.0.3 app/controllers/alchemy/elements_controller.rb
alchemy_cms-3.0.2 app/controllers/alchemy/elements_controller.rb
alchemy_cms-3.0.1 app/controllers/alchemy/elements_controller.rb
alchemy_cms-3.0.0 app/controllers/alchemy/elements_controller.rb
alchemy_cms-3.0.0.rc8 app/controllers/alchemy/elements_controller.rb
alchemy_cms-3.0.0.rc7 app/controllers/alchemy/elements_controller.rb
alchemy_cms-3.0.0.rc6 app/controllers/alchemy/elements_controller.rb
alchemy_cms-3.0.0.rc5 app/controllers/alchemy/elements_controller.rb