Sha256: b5c9f7532fb29a3751be6bf944a5edd617261e712d0997b482ec3b3521f413c7

Contents?: true

Size: 447 Bytes

Versions: 7

Compression:

Stored size: 447 Bytes

Contents

module RDecorator
  module ViewContext
    class << self
      def current
        Thread.current[:view_context]
      end

      def current=(view_context)
        Thread.current[:view_context] = view_context
      end
    end

    module Filter
      extend ActiveSupport::Concern

      included do
        before_filter do |controller|
          RDecorator::ViewContext.current = controller.view_context
        end
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
r_decorator-0.0.7 lib/r_decorator/view_context.rb
r_decorator-0.0.6 lib/r_decorator/view_context.rb
r_decorator-0.0.5 lib/r_decorator/view_context.rb
r_decorator-0.0.4 lib/r_decorator/view_context.rb
r_decorator-0.0.3 lib/r_decorator/view_context.rb
r_decorator-0.0.2 lib/r_decorator/view_context.rb
r_decorator-0.0.1 lib/r_decorator/view_context.rb