Files

Cell::ActionController

These ControllerMethods are automatically added to all Controllers when the cells plugin is loaded.

Public Instance Methods

expire_cell_state(cell_name, state, args={}, opts=nil) click to toggle source

Expires the cached cell state view, similar to ActionController::expire_fragment. Usually, this method is used in Sweepers. Beside the obvious first two args cell_name and state you can pass in additional cache key args and cache store specific opts.

Example:

 class ListSweeper < ActionController::Caching::Sweeper
  observe List, Item

  def after_save(record)
    expire_cell_state :my_listing, :display_list
  end

will expire the view for state :display_list in the cell MyListingCell.

# File lib/rails_extensions.rb, line 66
    def expire_cell_state(cell_name, state, args={}, opts=nil)
      key = Cell::Base.cache_key_for(cell_name, state, args)
      Cell::Base.expire_cache_key(key, opts)
    end
render_cell(name, state, opts={}) click to toggle source

Equivalent to ActionController#render_to_string, except it renders a cell rather than a regular templates.

# File lib/rails_extensions.rb, line 42
    def render_cell(name, state, opts={})
      cell = Cell::Base.create_cell_for(self, name, opts)

      return cell.render_state(state)
    end
Also aliased as: render_cell_to_string
render_cell_to_string(name, state, opts={}) click to toggle source

Alias for render_cell

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.