For the label problem I have been using the I18n-label plugin in the
past:
http://github.com/iain/i18n_label
This functionality may be integrated into the latest version of I18n,
I dont know.



On Apr 21, 9:50 am, Alexandre Friquet <[email protected]> wrote:
> Hi,
>
>
>
> > If I should believe the things I find on the internet, this is the
> > correct approach for form labels:
> > ---
> > en:
> >  activerecord:
> >    attributes:
> >      user:
> >        last_name: Surname
> > ---
> > And then:
>
> > <% form_for @user do |f| %>
> >  <%= f.label :last_name %>
> >  <%= f.text_field :last_name %>
> > <% end %>
>
> > However, this results in a form label "Last name" instead of
> > "Surname". What am I doing wrong? I'm on Rails 2.3.5.
>
> For the moment I think this is the normal behavior but it will be available 
> with 
> Rails3:http://guides.rails.info/3_0_release_notes.html#internationalization
>
> For the moment, what I do is :
>
> <% form_for @user do |f| %>
>  <%= f.label t('activerecord.attributes.user.last_name') %>
>  <%= f.text_field :last_name %>
> <% end %>
>
> Not so clean but it works...
>
> @+
> @lex
>
>  smime.p7s
> 2KViewDownload

-- 
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 [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to