Other helpers use the :url and :html option convention (remote_form_tag comes to mind)... and considering you have to handle builder options, url options and html options I think the old API is the cleanest syntax:

form_for :comment, comment, :url => named_route_url, :html => { 'id' => 'some-form' }, :builder => LabellingFormBuilder

btw the fix for this is trivial, replace:

concat(form_tag(options, options.delete(:html) || {}), proc.binding)

with:

concat(form_tag(options.delete(:url) || {}, options.delete(:html) || {}), proc.binding)

I'll file a bug with some tests but for now the patch is below.

-- tim

Index: actionpack/lib/action_view/helpers/form_helper.rb
===================================================================
--- actionpack/lib/action_view/helpers/form_helper.rb   (revision 3664)
+++ actionpack/lib/action_view/helpers/form_helper.rb   (working copy)
@@ -122,7 +122,7 @@
       #
       def form_for(object_name, object, options = {}, &proc)
         raise ArgumentError, "Missing block" unless block_given?
- concat(form_tag(options, options.delete(:html) || {}), proc.binding) + concat(form_tag(options.delete(:url) || {}, options.delete (:html) || {}), proc.binding)
         fields_for(object_name, object, options, &proc)
         concat('</form>', proc.binding)
       end

_______________________________________________
Rails-core mailing list
[email protected]
http://lists.rubyonrails.org/mailman/listinfo/rails-core

Reply via email to