我的模型中有这个:
class Person < ActiveRecord::Base
RELATIONSHIP_STATUSES = [
"single",
"in a relationship",
"together",
"it's complicated"
]
validates :relationship_status, :inclusion => RELATIONSHIP_STATUSES
end
这在视图中:
collection_select(:person, :relationship_status, Person::RELATIONSHIP_STATUSES, :to_s)
我想把它翻译成simple_form。那可能吗?