Hi all,
I’m trying to create a related dropdown box:
In my view:
Select category <% @categories.each do |category| %> <%= category.title %> <% end %> No Brand <% for brand in @brands -%> <%= brand.title %> <% end -%><%= observe_field(“category”,
:frequency => 0.25,
:update => “brand_id_container”,
:url => { :action => :get_brands_for_category },
:with => “‘category_id=’+value”) %>
In my controller:
def get_brands_for_category
@brands = Brand.find_all_by_category_id(@params[“category_id”])
end
Somehow it does not work. The related dropdown list does not change
contents. Does anybody have an idea why?
Regards,
Harm de Laat