Message from discussion
FormHelper#fields_for: second argument to the block
Received: by 10.52.16.113 with SMTP id f17mr7733598vdd.3.1351260218067;
Fri, 26 Oct 2012 07:03:38 -0700 (PDT)
X-BeenThere: rubyonrails-core@googlegroups.com
Received: by 10.52.141.116 with SMTP id rn20ls4757970vdb.5.gmail; Fri, 26 Oct
2012 07:03:33 -0700 (PDT)
Received: by 10.52.76.36 with SMTP id h4mr3530158vdw.17.1351260213582;
Fri, 26 Oct 2012 07:03:33 -0700 (PDT)
Date: Fri, 26 Oct 2012 07:03:33 -0700 (PDT)
From: Matt Huggins <matt.hugg...@gmail.com>
To: rubyonrails-core@googlegroups.com
Message-Id: <d6084e35-2e2e-4411-8f18-2f9a9df26265@googlegroups.com>
In-Reply-To: <CAC9YFzc9AdimufeP554txv1yu=2wukX7Rhv4aJf_Eg8DMk6uSw@mail.gmail.com>
References: <8ca9f8f5-0cf7-467c-a0df-6c249cf73846@googlegroups.com>
<CAC9YFzc9AdimufeP554txv1yu=2wukX7Rhv4aJf_Eg8DMk6uSw@mail.gmail.com>
Subject: Re: [Rails-core] FormHelper#fields_for: second argument to the
block
MIME-Version: 1.0
Content-Type: multipart/mixed;
boundary="----=_Part_367_2470738.1351260213269"
------=_Part_367_2470738.1351260213269
Content-Type: multipart/alternative;
boundary="----=_Part_368_18872230.1351260213269"
------=_Part_368_18872230.1351260213269
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
I agree with Rafael, this seems unnecessary.
On Friday, October 26, 2012 8:39:16 AM UTC-4, Rafael Mendon=C3=A7a Fran=C3=
=A7a wrote:
>
> I don't know if it is worth. You can use builder.object right now. This=
=20
> can confuse the users with one more way to access the object. I prefer to=
=20
> keep the API simple.
>
> Rafael Mendon=C3=A7a Fran=C3=A7a
> http://twitter.com/rafaelfranca
> https://github.com/rafaelfranca
>
>
>
> On Thu, Oct 25, 2012 at 9:33 PM, glaszig <gla...@gmail.com <javascript:>>=
wrote:
>
>> hello everybody.
>>
>> i think it'd be very convenient to have the builder#object as an optiona=
l=20
>> second parameter in the block for fields_for, e.g.:
>>
>> fields_for(:comments) do |builder, object|
>> # builder.object =3D=3D=3D object
>> end
>>
>> my proposal in code:
>>
>> https://github.com/glaszig/rails/commit/f22095f0ac120852fff7efc61b6bdf74=
01b39ad5
>>
>> before i request a pull - what do you think?
>>
>> --=20
>> You received this message because you are subscribed to the Google Group=
s=20
>> "Ruby on Rails: Core" group.
>> To view this discussion on the web visit=20
>> https://groups.google.com/d/msg/rubyonrails-core/-/DpEfiDSbYcUJ.
>> To post to this group, send email to rubyonra...@googlegroups.com<javasc=
ript:>
>> .
>> To unsubscribe from this group, send email to=20
>> rubyonrails-co...@googlegroups.com <javascript:>.
>> For more options, visit this group at=20
>> http://groups.google.com/group/rubyonrails-core?hl=3Den.
>>
>
>
------=_Part_368_18872230.1351260213269
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: quoted-printable
I agree with Rafael, this seems unnecessary.<br><br>On Friday, October 26, =
2012 8:39:16 AM UTC-4, Rafael Mendon=C3=A7a Fran=C3=A7a wrote:<blockquote c=
lass=3D"gmail_quote" style=3D"margin: 0;margin-left: 0.8ex;border-left: 1px=
#ccc solid;padding-left: 1ex;"><div style=3D"font-size:1em;font-family:Hel=
vetica,arial,freesans,clean,sans-serif;color:rgb(34,34,34);background-color=
:rgb(255,255,255);border:none;line-height:1.2">
<p style=3D"margin:1em 0px">I don't know if it is worth. You can use <code =
style=3D"font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospac=
e;margin:0px 0.15em;padding:0px 0.3em;white-space:nowrap;border:1px solid r=
gb(234,234,234);background-color:rgb(248,248,248);border-top-left-radius:3p=
x;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-=
left-radius:3px;display:inline">builder.object</code> right now. This can c=
onfuse the users with one more way to access the object. I prefer to keep t=
he API simple.</p>
</div><div><br clear=3D"all">Rafael Mendon=C3=A7a Fran=C3=A7a<br><a href=3D=
"http://twitter.com/rafaelfranca" target=3D"_blank">http://twitter.com/<wbr=
>rafaelfranca</a><br><a href=3D"https://github.com/rafaelfranca" target=3D"=
_blank">https://github.com/<wbr>rafaelfranca</a><br>
<br>
<br><br><div class=3D"gmail_quote">On Thu, Oct 25, 2012 at 9:33 PM, glaszig=
<span dir=3D"ltr"><<a href=3D"javascript:" target=3D"_blank" gdf-obfusc=
ated-mailto=3D"U8T05gA9xtYJ">gla...@gmail.com</a>></span> wrote:<br><blo=
ckquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #c=
cc solid;padding-left:1ex">
hello everybody.<div><div><br></div><div>i think it'd be very convenient to=
have the builder#object as an optional second parameter in the block for f=
ields_for, e.g.:</div><div><br></div><div>fields_for(:comments) do |builder=
, object|</div>
<div> # builder.object =3D=3D=3D object</div><div>end</div><div><br><=
/div><div>my proposal in code:</div><div><a href=3D"https://github.com/glas=
zig/rails/commit/f22095f0ac120852fff7efc61b6bdf7401b39ad5" target=3D"_blank=
">https://github.com/glaszig/<wbr>rails/commit/<wbr>f22095f0ac120852fff7efc=
61b6bdf<wbr>7401b39ad5</a><br>
</div><div><br></div><div>before i request a pull - what do you think?</div=
></div><span><font color=3D"#888888">
<p></p>
-- <br>
You received this message because you are subscribed to the Google Groups "=
Ruby on Rails: Core" group.<br>
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/d/msg/rubyonrails-core/-/DpEfiDSbYcUJ" target=3D"_blank">https://groups.=
google.com/d/<wbr>msg/rubyonrails-core/-/<wbr>DpEfiDSbYcUJ</a>.<br>=20
To post to this group, send email to <a href=3D"javascript:" target=3D"_bla=
nk" gdf-obfuscated-mailto=3D"U8T05gA9xtYJ">rubyonra...@googlegroups.<wbr>co=
m</a>.<br>
To unsubscribe from this group, send email to <a href=3D"javascript:" targe=
t=3D"_blank" gdf-obfuscated-mailto=3D"U8T05gA9xtYJ">rubyonrails-co...@<wbr>=
googlegroups.com</a>.<br>
For more options, visit this group at <a href=3D"http://groups.google.com/g=
roup/rubyonrails-core?hl=3Den" target=3D"_blank">http://groups.google.com/<=
wbr>group/rubyonrails-core?hl=3Den</a>.<br>
</font></span></blockquote></div><br></div>
</blockquote>
------=_Part_368_18872230.1351260213269--
------=_Part_367_2470738.1351260213269--