These ControllerMethods are automatically added to all Controllers when the cells plugin is loaded.
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
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
Disabled; run with --debug to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.