Re: [Rails-core] FormHelper#fields_for: second argument to the block

55 views
Skip to first unread message

Rafael Mendonça França

unread,
Oct 26, 2012, 8:38:31 AM10/26/12
to rubyonra...@googlegroups.com

I don't know if it is worth. You can use builder.object right now. This can confuse the users with one more way to access the object. I prefer to keep the API simple.


Rafael Mendonça França
http://twitter.com/rafaelfranca
https://github.com/rafaelfranca



On Thu, Oct 25, 2012 at 9:33 PM, glaszig <gla...@gmail.com> wrote:
hello everybody.

i think it'd be very convenient to have the builder#object as an optional second parameter in the block for fields_for, e.g.:

fields_for(:comments) do |builder, object|
  # builder.object === object
end

my proposal in code:

before i request a pull - what do you think?

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group.
To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-core/-/DpEfiDSbYcUJ.
To post to this group, send email to rubyonra...@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-co...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en.

Matt Huggins

unread,
Oct 26, 2012, 10:03:33 AM10/26/12
to rubyonra...@googlegroups.com
I agree with Rafael, this seems unnecessary.
Reply all
Reply to author
Forward
0 new messages