1
我有这个在我的模型:翻译形式帮手simple_form或formstatic
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。那可能吗?
你不需要的:作为选择,如果你想使用的选择集 – rafaelfranca