I have a model named Role. And i am using the helper below in a form. Is there a way to change the value of name attribute to another language?
<%= f.col
In the model:
class Role < ActiveRecord::Base def translated_name I18n.t(name, :scope => 'role') end end
In the view:
<%= f.collection_select :role_id, Role.all, :id, :translated_name -%>