1
をsimple_formかformstaticするフォームヘルパーを翻訳:私は私のモデルでこれを持って
collection_select(:person, :relationship_status, Person::RELATIONSHIP_STATUSES, :to_s)
そして私はsimple_formにそれを翻訳したいと思います:
ビューでclass Person < ActiveRecord::Base
RELATIONSHIP_STATUSES = [
"single",
"in a relationship",
"together",
"it's complicated"
]
validates :relationship_status, :inclusion => RELATIONSHIP_STATUSES
end
これ。それは可能ですか?
あなたは必要ありません:あなたは選択のコレクションを使用する場合は、オプションとして – rafaelfranca