Sha256: 4b4e5c7a1ab47d91c9cbedd667b6dc3d9313466a4b7217cb3860e8b4868476d5

Contents?: true

Size: 618 Bytes

Versions: 1

Compression:

Stored size: 618 Bytes

Contents

module RenderSync

  module ControllerHelpers

    include Actions

    def self.included(base)
      base.extend ClassMethods
    end

    module ClassMethods
      def enable_sync(options = {})
        around_filter :enable_sync, options
      end
    end


    private

    def enable_sync
      RenderSync::Model.enable(sync_render_context) do
        yield
      end
    end

    # ControllerHelpers overrides Action#sync_render_context to use self as
    # context to allow full access to request/response cycle
    # over default abstract Renderer class
    def sync_render_context
      self
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
render_sync-0.5.0 lib/render_sync/controller_helpers.rb