Permalink
Browse files

Use block syntax to avoid code duplication

  • Loading branch information...
1 parent 336f973 commit 014da68634c59a7df1950dd7b838fd0ba5181969 @rafaelfranca rafaelfranca committed Jan 18, 2012
Showing with 3 additions and 3 deletions.
  1. +3 −3 actionpack/lib/action_view/helpers/form_helper.rb
@@ -376,9 +376,9 @@ def form_for(record, options = {}, &proc)
builder = options[:parent_builder] = instantiate_builder(object_name, object, options, &proc)
fields_for = fields_for(object_name, object, options, &proc)
default_options = builder.multipart? ? { :multipart => true } : {}
- output = form_tag(options.delete(:url) || {}, default_options.merge!(options.delete(:html)))
- output << fields_for
- output.safe_concat('</form>')
+ default_options.merge!(options.delete(:html))
+
+ form_tag(options.delete(:url) || {}, default_options) { fields_for }
end
def apply_form_for_options!(record, object, options) #:nodoc:

0 comments on commit 014da68

Please sign in to comment.