sorting - Rails - order by, with grouped_collection_select -
this input select box shows list of issues based on selection of input select box displays values in school.rb model. but, lists issues issue_id. need list , sort name column of issue.rb model in alphabetical order.
i've tried every combination can think of!
thanks in advance..
<%= f.grouped_collection_select :issue_id, school.all, :issues, :name, :id, :name, :prompt => ""%>
shot in dark without seeing models:
<%= f.grouped_collection_select :issue_id, school.all, :issues, :name, :id, :name, :include_blank => true %> then add default scope issues model.
default_scope :order => 'issues.name asc'
Comments
Post a Comment