Flowdock
method

fragment_for

Importance_0
v2.1.0 - Show latest stable - 0 notes - Class: ActionController::Caching::Fragments
fragment_for(block, name = {}, options = nil) public

No documentation

This method has no description. You can help the Ruby on Rails community by adding new notes.

Hide source
# File actionpack/lib/action_controller/caching/fragments.rb, line 63
      def fragment_for(block, name = {}, options = nil) #:nodoc:
        unless perform_caching then block.call; return end

        buffer = yield

        if cache = read_fragment(name, options)
          buffer.concat(cache)
        else
          pos = buffer.length
          block.call
          write_fragment(name, buffer[pos..-1], options)
        end
      end
Register or log in to add new notes.