Translate form helper to simple_form or formstatic
I have this in my model:
class Person < ActiveRecord::Base
RELATIONSHIP_STATUSES = [
"single",
"in a relationship",
"together",
"it's complicated"
]
validates :relationship_status, :inclusion => RELATIONSHIP_STATUSES
end
This in the view:
collection_select(:pers开发者_开发技巧on, :relationship_status, Person::RELATIONSHIP_STATUSES, :to_s)
And I would like to translate that to simple_form. Is that possible?
If I understood you right, it's simple(it's for formtastic
):
<%= form.input :relationship_status, :as => :select, :collection => Person::RELATIONSHIP_STATUSES %>
精彩评论