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

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to