Sha256: 13f38e32ea0c3e2104376def1353c0a05a0d3a56d831f1de77b83d99d1a29888

Contents?: true

Size: 1.06 KB

Versions: 117

Compression:

Stored size: 1.06 KB

Contents

# frozen_string_literal: true

module ActionView
  # = Action View Context
  #
  # Action View contexts are supplied to Action Controller to render a template.
  # The default Action View context is ActionView::Base.
  #
  # In order to work with Action Controller, a Context must just include this
  # module. The initialization of the variables used by the context
  # (@output_buffer, @view_flow, and @virtual_path) is responsibility of the
  # object that includes this module (although you can call _prepare_context
  # defined below).
  module Context
    attr_accessor :output_buffer, :view_flow

    # Prepares the context by setting the appropriate instance variables.
    def _prepare_context
      @view_flow     = OutputFlow.new
      @output_buffer = nil
      @virtual_path  = nil
    end

    # Encapsulates the interaction with the view flow so it
    # returns the correct buffer on +yield+. This is usually
    # overwritten by helpers to add more behavior.
    def _layout_for(name = nil)
      name ||= :layout
      view_flow.get(name).html_safe
    end
  end
end

Version data entries

117 entries across 111 versions & 10 rubygems

Version Path
zuora_connect_ui-0.10.0 vendor/ruby/2.6.0/gems/actionview-6.0.0/lib/action_view/context.rb
actionview-6.0.2.rc1 lib/action_view/context.rb
zuora_connect_ui-0.9.2 vendor/ruby/2.6.0/gems/actionview-6.0.1/lib/action_view/context.rb
zuora_connect_ui-0.9.2 vendor/ruby/2.6.0/gems/actionview-6.0.0/lib/action_view/context.rb
actionview-6.0.1 lib/action_view/context.rb
chatops-rpc-0.0.2 fixtures/chatops-controller-example/vendor/bundle/ruby/2.5.0/gems/actionview-6.0.0/lib/action_view/context.rb
actionview-6.0.1.rc1 lib/action_view/context.rb
chatops-rpc-0.0.1 fixtures/chatops-controller-example/vendor/bundle/ruby/2.5.0/gems/actionview-6.0.0/lib/action_view/context.rb
zuora_connect_ui-0.9.1 vendor/ruby/2.6.0/gems/actionview-6.0.0/lib/action_view/context.rb
zuora_connect_ui-0.9.0 vendor/ruby/2.6.0/gems/actionview-6.0.0/lib/action_view/context.rb
zuora_connect_ui-0.8.3 vendor/ruby/2.6.0/gems/actionview-6.0.0/lib/action_view/context.rb
zuora_connect_ui-0.8.2 vendor/ruby/2.6.0/gems/actionview-6.0.0/lib/action_view/context.rb
actionview-6.0.0 lib/action_view/context.rb
actionview-6.0.0.rc2 lib/action_view/context.rb
actionview-6.0.0.rc1 lib/action_view/context.rb
actionview-6.0.0.beta3 lib/action_view/context.rb
actionview-6.0.0.beta2 lib/action_view/context.rb