Sha256: caf4f42dbe68d65568cdecb1988209c1ac93135c129d103b87908dd9af0472c6

Contents?: true

Size: 717 Bytes

Versions: 5

Compression:

Stored size: 717 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

5 entries across 5 versions & 1 rubygems

Version Path
cells-3.6.5 lib/cell/rails3_1_strategy.rb
cells-3.6.4 lib/cell/rails3_1_strategy.rb
cells-3.6.3 lib/cell/rails3_1_strategy.rb
cells-3.6.2 lib/cell/rails3_1_strategy.rb
cells-3.6.1 lib/cell/rails3_1_strategy.rb