f.label ''something'' produces Something instead of something How can I force f.label to have a lower case initial letter? -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
f.label :something, "something" :-) Lasse 2010/2/14 Ralph Shnelvar <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org>> f.label ''something'' > > produces > Something > instead of > something > > > How can I force f.label to have a lower case initial letter? > -- > Posted via http://www.ruby-forum.com/. > > -- > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Talk" group. > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<rubyonrails-talk%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> > . > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. > >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Lasse Bunk wrote:> f.label :something, "something" > > :-) Lasse > > 2010/2/14 Ralph Shnelvar <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org>Well ... that certainly was simple .... but then what is the purpose of the first parameter? What are the downsides to f.label '''', "something" ? -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Yeah it''s pretty simple :-) The purpose of the first parameter is to provide an ID for the label and optionally a default text for the label. This is used if you don''t provide a second parameter. Check out http://api.rubyonrails.org/classes/ActionView/Helpers/FormHelper.html#M001604 and http://api.rubyonrails.org/classes/ActionView/Helpers/FormHelper.html#M001606 :-) Lasse 2010/2/14 Ralph Shnelvar <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org>> Lasse Bunk wrote: > > f.label :something, "something" > > > > :-) Lasse > > > > 2010/2/14 Ralph Shnelvar <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> > > Well ... that certainly was simple .... but then what is the purpose of > the first parameter? What are the downsides to > f.label '''', "something" > ? > > -- > Posted via http://www.ruby-forum.com/. > > -- > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Talk" group. > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<rubyonrails-talk%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> > . > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. > >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Ralph Shnelvar wrote:> Lasse Bunk wrote: >> f.label :something, "something" >> >> :-) Lasse >> >> 2010/2/14 Ralph Shnelvar <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> > > Well ... that certainly was simple .... but then what is the purpose of > the first parameter? What are the downsides to > f.label '''', "something" > ?OK ... I sniffed around on the ''net to try to answer my own question. Apparently the first field becomes the target of the forHTML parameter. The "for=" field, in turn, becomes associated with another html tag''s (e.g. an input tag.) So - - - - - <label for="xyzzy">Whatever</label> Put anything here <input type="checkbox" id="xyzzy" value="check me" /> - - - - associates the label with the input. Thus (from ActionView::Helpers::FormTagHelper) documentation http://api.rubyonrails.org/classes/ActionView/Helpers/FormHelper.html#M001606 label(:post, :title) # => <label for="post_title">Title</label> now makes sense to me. One now has a css tag to play with. Thank you, Lasse Bunk. Sometimes the most trivial of answers helps the most. -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Super – glad you found out :-) Lasse 2010/2/14 Ralph Shnelvar <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org>> Ralph Shnelvar wrote: > > Lasse Bunk wrote: > >> f.label :something, "something" > >> > >> :-) Lasse > >> > >> 2010/2/14 Ralph Shnelvar <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> > > > > Well ... that certainly was simple .... but then what is the purpose of > > the first parameter? What are the downsides to > > f.label '''', "something" > > ? > > OK ... I sniffed around on the ''net to try to answer my own question. > > Apparently the first field becomes the target of the > for> HTML parameter. The "for=" field, in turn, becomes associated with > another html tag''s (e.g. an input tag.) > > So > > - - - - - > <label for="xyzzy">Whatever</label> > Put anything here > <input type="checkbox" id="xyzzy" value="check me" /> > - - - - > > associates the label with the input. Thus > (from ActionView::Helpers::FormTagHelper) documentation > > http://api.rubyonrails.org/classes/ActionView/Helpers/FormHelper.html#M001606 > > label(:post, :title) > # => <label for="post_title">Title</label> > > now makes sense to me. One now has a css tag to play with. > > Thank you, Lasse Bunk. Sometimes the most trivial of answers helps the > most. > -- > Posted via http://www.ruby-forum.com/. > > -- > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Talk" group. > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<rubyonrails-talk%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> > . > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. > >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
kwerle-e+AXbWqSrlAAvxtiuMwx3w@public.gmane.org
2010-Feb-15 19:17 UTC
Re: forcing lower case in form helper label
On Feb 14, 8:31 am, Ralph Shnelvar <li...-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> Lasse Bunk wrote: > > f.label :something, "something" > > > :-) Lasse > > > 2010/2/14 Ralph Shnelvar <li...-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> > > Well ... that certainly was simple .... but then what is the purpose of > the first parameter? What are the downsides to > f.label '''', "something"That''s one option. Another, maybe better in the long run, is to use the localization files. Check out the FormHelper docs. en.yml --- en: hello: "Hello world" helpers: label: foo: something: "zomething" --- This will make the label for foo''s "something" appear as "zomething" (lower case). By using the localization file, you can get consistent displaying. In addition, you may be able to localize some pages or partials without having to do _partial.<2letter_code>.html.erb --- Kurt Werle Looking for a new rails job: http://www.circlew.org/kurt/pages/resume -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.