Sha256: 897ccd2dfaebf67c4e1639130a25c81ced8b0d11589cefbd36505eeb13f68225

Contents?: true

Size: 719 Bytes

Versions: 6

Compression:

Stored size: 719 Bytes

Contents

module Cell
  # Methods to be included in Cell::Rails in 3.1 context.
  module VersionStrategy
    extend ActiveSupport::Concern
    
    include AbstractController::UrlFor  # must be included before _routes is set in Railstie.
    
    
    module ClassMethods
      def view_context_class
        @view_context_class ||= begin
          routes  = _routes  #if respond_to?(:_routes)
          helpers = _helpers #if respond_to?(:_helpers)
          Cell::Rails::View.prepare(routes, helpers)
        end
      end
    end
    
  private    
    def process_opts_for(opts, state)
      opts[:action] = opts[:view] || state
      
      lookup_context.formats = [opts.delete(:format)] if opts[:format]
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
cells-3.8.1 lib/cell/rails3_1_strategy.rb
cells-3.8.0 lib/cell/rails3_1_strategy.rb
cells-3.7.1 lib/cell/rails3_1_strategy.rb
cells-3.7.0 lib/cell/rails3_1_strategy.rb
cells-3.6.7 lib/cell/rails3_1_strategy.rb
cells-3.6.6 lib/cell/rails3_1_strategy.rb