Module: Fragmentary::FragmentsHelper
- Defined in:
- lib/fragmentary/fragments_helper.rb
Defined Under Namespace
Classes: CacheBuilder
Instance Method Summary collapse
Instance Method Details
#cache_fragment(options, &block) ⇒ Object
5 6 7 8 |
# File 'lib/fragmentary/fragments_helper.rb', line 5 def cache_fragment(, &block) .reverse_merge!(Fragmentary.config.application_root_url_column => Fragmentary.application_root_url.gsub(%r{https?://}, '')) CacheBuilder.new(self).cache_fragment(, &block) end |
#fragment_builder(options) ⇒ Object
10 11 12 13 14 15 16 |
# File 'lib/fragmentary/fragments_helper.rb', line 10 def fragment_builder() # the template option is deprecated but avoids breaking prior usage template = .delete(:template) || self .reverse_merge!(:user => Template.new(template).current_user) .reverse_merge!(Fragmentary.config.application_root_url_column => Fragmentary.application_root_url.gsub(%r{https?://}, '')) CacheBuilder.new(template, Fragmentary::Fragment.base_class.existing()) end |