I have a controller and view that should be providing a search bar
that brings up that brings up a selected record on submission. I have
tried several variations, including just specifying the assets_path,
but usually end up with either an error or a submission to the index
action, rather than the show action. Currently, I have the following
in my index.html.haml:
= form_tag({:controller => ‘assets’, :action => ‘show’}, :method
=> :GET) do
.field
=label_tag(‘Job
Number’).titleize
%br/
=number_field_tag :id
.actions
=submit_tag ‘Search’, :name => nil
This gives me the following error:
No route matches {:controller=>“assets”, :action=>“show”}
$ rake routes | fgrep asset )
assets GET /
assets(.:format)
{:action=>“index”, :controller=>“assets”}
POST /
assets(.:format)
{:action=>“create”, :controller=>“assets”}
new_asset GET /assets/
new(.:format)
{:action=>“new”, :controller=>“assets”}
edit_asset GET /assets/:id/
edit(.:format)
{:action=>“edit”, :controller=>“assets”}
asset GET /
assets/:id(.:format)
{:action=>“show”, :controller=>“assets”}
PUT /
assets/:id(.:format)
{:action=>“update”, :controller=>“assets”}
DELETE /
assets/:id(.:format)
{:action=>“destroy”, :controller=>“assets”}
How can I get a form_tag to take the user to /asset/123 (or whatever)
as intended?