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:
parent
7ceb247db9
commit
b8614eae6f
1 changed files with 10 additions and 0 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Reference in a new issue