f.label ‘something’
produces
Something
instead of
something
How can I force f.label to have a lower case initial letter?
f.label ‘something’
produces
Something
instead of
something
How can I force f.label to have a lower case initial letter?
Lasse B. wrote:
f.label :something, “something”
Lasse
2010/2/14 Ralph S. [email protected]
Well … that certainly was simple … but then what is the purpose of
the first parameter? What are the downsides to
f.label ‘’, “something”
?
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
and
Lasse
2010/2/14 Ralph S. [email protected]
Ralph S. wrote:
Lasse B. wrote:
f.label :something, “something”
Lasse
2010/2/14 Ralph S. [email protected]
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
Whatever
Put anything here
associates the label with the input. Thus
(from ActionView::Helpers::FormTagHelper) documentation
label(:post, :title)
now makes sense to me. One now has a css tag to play with.
Thank you, Lasse B… Sometimes the most trivial of answers helps the
most.
On Feb 14, 8:31 am, Ralph S. [email protected] wrote:
Lasse B. wrote:
f.label :something, “something”
Lasse
2010/2/14 Ralph S. [email protected]
Well … that certainly was simple … but then what is the purpose of
the first parameter? What are the downsides to
f.label ‘’, “something”
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 W.
Looking for a new rails job: http://www.circlew.org/kurt/pages/resume
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.
Sponsor our Newsletter | Privacy Policy | Terms of Service | Remote Ruby Jobs