how do I order this by name?
<%= f.collection_select :carmodel_id_equals, Carmodel.all, :id, :name, :include_blank => true %>
I’ve looked in some search results in here but nothing worked.
p.s. this is a meta_search f.select form. Thanks.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
you just have to order your search results from
Carmodel.allby usingorderlike this:Carmodel.order('name ASC').allso if you put it all together it should look like:
<%= f.collection_select :carmodel_id_equals, Carmodel.order('name ASC').all, :id, :name, :include_blank => true %>Read more in the awesome Rails Guide