Module: ActionView::Helpers::FormHelper

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

Instance Method Summary collapse

Instance Method Details

#form_for_with_haml(object_name, *args, &proc) ⇒ Object Also known as: form_for



160
161
162
163
164
165
166
167
168
169
170
171
172
173
# File 'lib/haml/helpers/action_view_mods.rb', line 160

def form_for_with_haml(object_name, *args, &proc)
  if block_given? && is_haml?
    oldproc = proc
    proc = haml_bind_proc do |*args|
      tab_up
      oldproc.call(*args)
      tab_down
      concat haml_indent
    end
    concat haml_indent
  end
  form_for_without_haml(object_name, *args, &proc)
  concat "\n" if block_given? && is_haml?
end