Module: ActionView::Helpers::CacheHelper

Defined in:
lib/haml/helpers/action_view_mods.rb

Instance Method Summary collapse

Instance Method Details

#fragment_for_with_haml(*args, &block) Also known as: fragment_for

This is a workaround for a Rails 3 bug that's present at least through beta 3. Their fragment_for assumes that the block will return its contents as a string, which is not always the case. Luckily, it only makes this assumption if caching is disabled, so we only override that case.



185
186
187
188
# File 'lib/haml/helpers/action_view_mods.rb', line 185

def fragment_for_with_haml(*args, &block)
  return fragment_for_without_haml(*args, &block) if controller.perform_caching
  capture(&block)
end