1
0
Fork 0
mirror of https://github.com/haml/haml.git synced 2022-11-09 12:33:31 -05:00

Override ActionView's #capture helper, so that it can be safely used within a helper.

This commit is contained in:
Nathan Weizenbaum 2008-03-15 14:14:12 -07:00
parent 7ceb247db9
commit b8614eae6f

View file

@ -17,6 +17,16 @@ if defined?(ActionView) and not defined?(Merb::Plugins)
module Helpers
# :stopdoc:
module CaptureHelper
def capture_with_haml(*args, &block)
if is_haml?
capture_haml(*args, &block)
else
capture_without_haml(*args, &block)
end
end
alias_method :capture_without_haml, :capture
alias_method :capture, :capture_with_haml
def capture_erb_with_buffer_with_haml(*args, &block)
if is_haml?
capture_haml_with_buffer(*args, &block)