I have a controller, customs_shipment_pars_checks_controller, that has an action :new. I wish to provide a shortcut url to this action tha bypasses any frontend pages and embedded links.
In my routes.rb file I tried this:
map.resource :parscheck, :action => 'new', :controller => 'customs_shipment_pars_checks'
Which, in my ignorance I thought would equal this url:
http://localhost:3000/customs_shipment_pars_check/new
But it does not. Instead it is the equivalent of:
http://localhost:3000/customs_shipment_pars_check
Which fails with this:
NoMethodError in Customs_shipment_pars_checks#show
Now http://localhost:3000/parscheck/new works.
My question is how does one force a specific action (new) for a given url using the #resource idiom? What I want to be able to do is to have someone enter http:/host/parscheck and have them presented with the new template. Do I have to do this instead?
map.connect 'parscheck', :action => 'new', :controller => 'customs_shipment_pars_checks'