Module: MimeActor::Scene

Extended by:
ActiveSupport::Concern
Includes:
Validator
Included in:
Action
Defined in:
lib/mime_actor/scene.rb

Overview

# MimeActor Scene

Scene provides configuration for ‘action` + `format` definitions

NOTE: Calling the same ‘action`/`format` multiple times will overwrite previous `action` + `format` definitions.

Examples:

register a ‘html` format on action `create`

act_on_action :create, format: :html

register ‘html`, `json` formats on actions `index`, `show`

act_on_action :index, :show, format: [:html, :json]

register a ‘html` format on action `index` with respond handler method

act_on_action :index, format: :html, with: :render_html

register a ‘html` format on action `index` with respond handler Proc

act_on_action :index, format: :html, with: -> { render html: "<h1>my header</h1>" }

register a ‘html` format on action `index` with respond handler block

act_on_action :html, on: :index do
  render :index
end

Defined Under Namespace

Modules: ClassMethods