Hi, Instead of having on the labels the field name I would like to change it some customized values. How can I change that ? Regards %= form_for(@client_workout) do |f| %> <div class="field"> <%= f.label :client_name %><br /> <%= f.text_field :client_name %> </div> <div class="field"> <%= f.label :trainer %><br /> <%= f.text_field :trainer %> </div> <div class="field"> <%= f.label :duration_min %><br /> <%= f.text_field :duration_min %> </div> <div class="field"> <%= f.label :date_of_workout %><br /> <%= f.date_select :date_of_workout %> </div> <div class="field"> <%= f.label :paid_amount %><br /> <%= f.text_field :paid_amount %> </div> <div class="actions"> <%= f.submit %> </div> <% end %> -- 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 "My label" %><br /> On Sun, Aug 28, 2011 at 10:01 AM, Pepe Sanchez <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> Hi, > > Instead of having on the labels the field name I would like to change it > some customized values. > > How can I change that ? > > Regards > > %= form_for(@client_workout) do |f| %> > > > <div class="field"> > <%= f.label :client_name %><br /> > <%= f.text_field :client_name %> > </div> > <div class="field"> > <%= f.label :trainer %><br /> > <%= f.text_field :trainer %> > </div> > <div class="field"> > <%= f.label :duration_min %><br /> > <%= f.text_field :duration_min %> > </div> > <div class="field"> > <%= f.label :date_of_workout %><br /> > <%= f.date_select :date_of_workout %> > </div> > <div class="field"> > <%= f.label :paid_amount %><br /> > <%= f.text_field :paid_amount %> > </div> > <div class="actions"> > <%= f.submit %> > </div> > <% end %> > > -- > 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@googlegroups.com. > 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.
On Aug 28, 2011, at 19:44 , Noel wrote:> <%= f.label "My label" %><br /> >no f.label :field, "my name" https://github.com/rails/rails/blob/4145810150070160677df00345fe22c66e457c1c/actionpack/lib/action_view/helpers/form_helper.rb#L1179 tom> > On Sun, Aug 28, 2011 at 10:01 AM, Pepe Sanchez <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote: >> Hi, >> >> Instead of having on the labels the field name I would like to change it >> some customized values. >> >> How can I change that ? >> >> Regards >> >> %= form_for(@client_workout) do |f| %> >> >> >> <div class="field"> >> <%= f.label :client_name %><br /> >> <%= f.text_field :client_name %> >> </div> >> <div class="field"> >> <%= f.label :trainer %><br /> >> <%= f.text_field :trainer %> >> </div> >> <div class="field"> >> <%= f.label :duration_min %><br /> >> <%= f.text_field :duration_min %> >> </div> >> <div class="field"> >> <%= f.label :date_of_workout %><br /> >> <%= f.date_select :date_of_workout %> >> </div> >> <div class="field"> >> <%= f.label :paid_amount %><br /> >> <%= f.text_field :paid_amount %> >> </div> >> <div class="actions"> >> <%= f.submit %> >> </div> >> <% end %> >> >> -- >> 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. >> >> > > -- > 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.-- ==============================================================================Tomas Meinlschmidt, MS {MCT, MCP+I, MCSE, AER}, NetApp Filer/NetCache www.meinlschmidt.com www.maxwellrender.cz www.lightgems.cz ============================================================================== -- 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.
I always wondered, is there a way you can change the f.label at a model label so regardless of where its used it always has the updated label? is it somewhere in the localization file? or does this just indicate for rails to have a best guess at what it is. I tried defining them in a language file once but it never seemed to pick them up. On Aug 28, 1:44 pm, Noel <wwydi...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> <%= f.label "My label" %><br /> > > > > > > > > On Sun, Aug 28, 2011 at 10:01 AM, Pepe Sanchez <li...-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote: > > Hi, > > > Instead of having on the labels the field name I would like to change it > > some customized values. > > > How can I change that ? > > > Regards > > > %= form_for(@client_workout) do |f| %> > > > <div class="field"> > > <%= f.label :client_name %><br /> > > <%= f.text_field :client_name %> > > </div> > > <div class="field"> > > <%= f.label :trainer %><br /> > > <%= f.text_field :trainer %> > > </div> > > <div class="field"> > > <%= f.label :duration_min %><br /> > > <%= f.text_field :duration_min %> > > </div> > > <div class="field"> > > <%= f.label :date_of_workout %><br /> > > <%= f.date_select :date_of_workout %> > > </div> > > <div class="field"> > > <%= f.label :paid_amount %><br /> > > <%= f.text_field :paid_amount %> > > </div> > > <div class="actions"> > > <%= f.submit %> > > </div> > > <% end %> > > > -- > > Posted viahttp://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 athttp://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.
Thanks!! -- 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.