I've got the following model:
class Person < ActiveRecord::Base
enum gender: [:female, :male]
...
end
Then I added the selection of the gender to its form, like this:
<%= form_for ([@person]) do |f| %>
...
<div class="form-group">
<%= f.collection_radio_buttons :gender, Person.genders, :first, :first %>
</div>
...
<% end %>
But instead of displaying the constant as a string I want to translate it to Portuguese.
I already tried to add it to the pt.yml file under people but didn't work.
pt:
activerecord:
attributes:
female: Feminino
male: Mascúlino
I know this question is very similar to How to use i18n with Rails 4 enums but that question is already marked as answered and I'm searching for a better and simpler solution...
Thank you for taking your time to help me :)