Module: ActionView::Helpers::FormHelper
- Defined in:
- /build/buildd/ruby-haml-3.1.4/lib/haml/helpers/xss_mods.rb,
/build/buildd/ruby-haml-3.1.4/lib/haml/helpers/action_view_mods.rb,
/build/buildd/ruby-haml-3.1.4/lib/haml/helpers/action_view_mods.rb
Instance Method Summary (collapse)
- - form_for_with_haml(object_name, *args, &proc) (also: #form_for)
- - form_for_with_haml_xss(*args, &block)
Instance Method Details
- form_for_with_haml(object_name, *args, &proc) Also known as: form_for
177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 |
# File '/build/buildd/ruby-haml-3.1.4/lib/haml/helpers/action_view_mods.rb', line 177
def form_for_with_haml(object_name, *args, &proc)
wrap_block = block_given? && is_haml? && block_is_haml?(proc)
if wrap_block
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 wrap_block
Haml::Helpers::ErrorReturn.new("form_for") if is_haml?
end
|
- form_for_with_haml_xss(*args, &block)
131 132 133 134 135 |
# File '/build/buildd/ruby-haml-3.1.4/lib/haml/helpers/xss_mods.rb', line 131
def form_for_with_haml_xss(*args, &block)
res = form_for_without_haml_xss(*args, &block)
return Haml::Util.html_safe(res) if res.is_a?(String)
return res
end
|