I'm not sure I entirely understand your question, but I'll take a shot. You
can use variables in place of the label strings, and set those values in
your controller, helpers, wherever. They don't have to be static strings.
in controller:
case session[:language]
when 'fr': @labels{:type_operation => "Type d'opération"}
when 'en': @labels{:type_operation => 'Type of operation'}
end
then in the view:
<%= f.label :type_operation, @labels[:type_operation] %>
James Mason
Systems Administrator/Safety & Environmental Director
Yamato Engine Specialists
360-306-5017
On Thu, Sep 11, 2008 at 3:18 PM, miga <[EMAIL PROTECTED]> wrote:
>
> Say I have a form like this:
> <% form_for(@operation) do |f| %>
>
> <p><%= f.label :type_operation, "Type d'opération" %> : <%=
> f.text_field :type_operation %></p>
> <p><%= f.label :libelle, "Libellé" %> : <%= f.text_field :libelle
> %></p>
> <p>
> <%= f.submit "Créer" %>
> </p>
> <% end %>
>
> Is there a way to put the customized labels in the
> operations_helper.rb file, so that it applies to new, edit, etc.
> forms? And if it is possible, how to do it?
>
>
> >
>
Confidentiality Notice:
The documents accompanying this electronic transmission may contain
confidential information. The information is intended only for the use of the
individual(s) or entity named above. If you are not the intended recipient, you
are notified that any disclosure, copying, distribution or taking of any action
in reliance on the contents of this electronic information is not permissible.
If you have received this electronic document in error, please immediately
notify us by telephone at (360)733-1916.
Thank you.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "ruby-on-rails-programming-with-passion" group.
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/ruby-on-rails-programming-with-passion?hl=en?hl=en
-~----------~----~----~----~------~----~------~--~---