Translating label for references collection_select
i have form with one selectbox (collection_select) for references column. What is proper way to translate label for this widget? For all others a use default Model.human_attribute_name (my code, Translations for Active Record M开发者_运维百科odels)
If you use in your [language].yml
file:
attributes:
my_model:
property: 'translatet property label'
[...]
You can simply use the following in your view:
<%= form_for([...]) do |f| %>
<div class="field">
<%= f.label :property %><br />
<%= f.collection_select [...] %>
</div>
[...]
精彩评论