Hi,
I'm trying to apply DRY concept so when I want to display an product for example, I have /article/show/2 using the id to retrieve data. But if I want to use the same action with a reference field instead of id, what should I do?
I'm using a form, so I display the ref in the select box sending the id
the source page seems ok tooPHP Code:<%= start_form_tag :controller => 'product', :action => 'show' %>
<p>Ref.:<%= collection_select("product", "id", @references, "id", "reference") %>
<%= submit_tag "search" %></p>
but it doesn't work, I still get Couldn't find Product without an IDPHP Code:<option value="11">IPA235</option>
Did I forget something?





Bookmarks