I am trying to create a drop down of categories and that same drop down should also have subcategories of currently selected category.
for category drop down I use something like
<%= collection_select(:category, :id, Category.find(:all), :id, :name) %>
but I would like to do something like
<%= collection_select(:category, :id, Category.find(:all).each do |cat| if cat.name?(currently_selected) Subcategory.find(:cat.name), :id, :name) %>
any ideas?.