Module: Imprenta::CachePage

Defined in:
lib/imprenta/cache_page.rb

Instance Method Summary collapse

Instance Method Details

#imprenta_cache_template(args = {}) ⇒ Object



4
5
6
7
8
9
10
11
# File 'lib/imprenta/cache_page.rb', line 4

def imprenta_cache_template(args = {})
  template = args.fetch(:template)
  layout = args.fetch(:layout) { 'application'}
  id = args.fetch(:id)

  content = render_to_string(template: template, layout: layout)
  storage.persist(content, id)
end