Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

RoR problem with related_collection_select

Status
Not open for further replies.

mercwiz

Programmer
Jul 22, 2004
6
US
I am using collection_select to get a list of manufacturers and then I am using related_collection_select to list items produced by the selected manufacturer. I get the error message: "$ is not Defined" in the error console of firefox.
When looking at the page source the related_collection_select collection is producing a correct list of items for all manufacturers but based on the selection of manufacturer it cannot extract the list of items for that manufacturer.
<%= collection_select :manufacturer, :id, Manufacturer.find:)all, :select => "manufacturers.id, manufacturers.name", :eek:rder => "name"), :id, :name, {:prompt => ""} %>
<%= related_collection_select :item, :id, [:manufacturer, :id], Item.find_by_sql("SELECT items.* FROM items LEFT JOIN item_sort_options ON items.id = item_sort_options.item_id ORDER BY position"), :id, :label, :manufacturer_id, { }, { :style => "width: 300px" } %>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top