Re: [Rails] Re: Filter on multiple select
On 17 December 2012 08:49, Lorenz Blackbird <lists@ruby-forum.com> wrote:
> Sorry for the double post.
>
> I try to use squeel gem in this way:
>
> <%= f.select :students_ids, Student.where(:course_id =>
> @exam.course_id).map { |student| [student.name, student.id] }, { }, {
> multiple: true } %>
Instead of Student.where(:course_id => @exam.course_id) use
@exam.course.students
Also I don't see where the squeel gem is relevant to the code you showed.
Colin
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home