Answer the question
In order to leave comments, you need to log in
How to filter a field saved from select multiple?
Good afternoon!
The Person model has a year property. When editing a model, this field is filled in from
<%= f.select(:pdate, (@years), {:include_blank => false}, {:multiple => true}) %>
serialize :year;
---
- '2014'
- '2011'
@year = 2011.to_s
@people = Person.where('year like ?', "%#{@year}%").all
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question