Hello all, I've just started to play around on Ruby and have read some tutorials, books, and Why's guide. I do understand syntax of coding, or at least that within the controller, but I have limited web programming experience, so the view is giving me some problems. So here is the issue,
I have a database of wines, that i'd like to be able to select by the producer, and then those the associated wines. I thought this would work, but I keep getting the 'Couldn't find Wine with ID=Show' error. Any help and or pointers on this would be great. Thanks a ton!
from view: <% form_for @wines, :url => { :action => 'Show' } do |f| %>
Producer: <%= collection_select(:wine,:desc,@wines,:id,:desc, options ={:prompt => "Select a producer"}) %>
<%= submit_tag 'Submit' %> <% end %>
from controller: def show @wine = Wine.find(params[:desc])
respond_to do |format| format.html # show.html.erb format.xml { render :xml => @wine } end end