Sha256: f191eea6af75a43382b10c8e81dafa4e58c4577b9ceb120a51280c38f590c2c9

Contents?: true

Size: 613 Bytes

Versions: 2

Compression:

Stored size: 613 Bytes

Contents

module Catche
  module Controller
    module Action

      extend ActiveSupport::Concern

      module ClassMethods

        # Caches an action in Rails.cache
        # See ActionController `caches_action` for more information
        #
        #   catches_action Project, :index
        def catches_action(model, *args)
          catche model, *args, :type => :action
        end

      end

      def _save_fragment(name, options={})
        if self.class.catche?
          key = fragment_cache_key(name)
          Catche::Tag.tag_view! key, *catche_tags
        end

        super
      end

    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
catche-0.2.3 lib/catche/controller/action.rb
catche-0.2.2 lib/catche/controller/action.rb