I am trying to create an application thats allows searching on an item
number. There are multiple items in the DB with the same number
(different vendors).
My index page has a simple form that just accepts an item number in a
form as:
<% form_tag(all_item_search_path) do %>
When I try to load this page, I get:
all_item_search_url failed to generate from
{:method=>:get, :action=>“search”, :controller=>“public”} - you may
have ambiguous routes, or you may need to supply additional parameters
for this route. content_url has the following required parameters:
[“search”, :item_number] - are they all satisfied?
My route.rb contains:
map.all_item_search “/search/:item_number”, :controller =>
“public”, :action => “search”, :method => :get
and rake routes gives me the following:
all_item_search /search/:item_number
{:method=>:get, :action=>“search”, :controller=>“public”}
I can enter a url in the browser as such:
http://localhost:3000/search/1234
I get the results of the search back.
Also, would it be better to use /search?item=1234 # item numbers are
alphanumeric and can have special characters
The last part of the question is how will an xml request be specified.
I know they are specified as /items.1.xml in a normal case.
Thank you
Don F.