Sha256: 0baa644f08a10228934ff811e8e115ae439c613ffc7c5faa73d4dcd78b2500c8

Contents?: true

Size: 379 Bytes

Versions: 10

Compression:

Stored size: 379 Bytes

Contents

module CachesActionWithoutHost

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

  module ClassMethods
    def caches_action_without_host(*args)
      options = args.extract_options!
      options ||= {}
      options[:cache_path] ||= proc{|c| c.url_for(c.params).split(/\//, 4).last}
      args << options
      caches_action(*args)
    end
  end

end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
rails_core_extensions-0.7.1 lib/rails_core_extensions/caches_action_without_host.rb
rails_core_extensions-0.7.0 lib/rails_core_extensions/caches_action_without_host.rb
rails_core_extensions-0.6.1 lib/rails_core_extensions/caches_action_without_host.rb
rails_core_extensions-0.6.0 lib/rails_core_extensions/caches_action_without_host.rb
rails_core_extensions-0.4.0 lib/rails_core_extensions/caches_action_without_host.rb
rails_core_extensions-0.3.0 lib/rails_core_extensions/caches_action_without_host.rb
rails_core_extensions-0.2.0 lib/rails_core_extensions/caches_action_without_host.rb
rails_core_extensions-0.1.1 lib/rails_core_extensions/caches_action_without_host.rb
rails_core_extensions-0.1.0 lib/rails_core_extensions/caches_action_without_host.rb
rails_core_extensions-0.0.1 lib/rails_core_extensions/caches_action_without_host.rb