try calling it using: curl <domain>/items/:id/price.html or price.json as needed.
format is needed when you call a route from outside without using named_path route. hope this helps. -- Aldo On Sun, Feb 20, 2011 at 8:37 PM, Phil Crissman <[email protected]>wrote: > > Phil > > > On Sun, Feb 20, 2011 at 5:31 PM, Leonardo Mateo > <[email protected]>wrote: > >> On Sun, Feb 20, 2011 at 8:14 PM, Phil Crissman <[email protected]> >> wrote: >> > >> > Phil >> > >> > >> > On Sun, Feb 20, 2011 at 4:07 PM, Leonardo Mateo < >> [email protected]> >> > wrote: >> >> >> >> Hi guys, >> >> I'm having this problem with a simple route. I have this on my >> routes.rb >> >> resources :items do >> >> member do >> >> post 'price' >> >> end >> >> end >> >> >> >> However, when I try to post to this route, I get this error: >> >> >> >> Started POST "/items/28/price" for 127.0.0.1 at 2011-02-20 18:52:10 >> -0300 >> >> >> >> ActionController::RoutingError (No route matches "/items/28/price"): >> >> >> >> Does anyone have any idea what am I doing wrong? >> > >> > First check: is this route listed when you do `rake routes | grep price` >> ? >> Yes, it is. This is the output >> [kandalf@bifur depot]$ rake routes | grep price >> price_item POST /items/:id/price(.:format) >> {:action=>"price", :controller=>"items"} >> >> > ... that's crazy, then. The route is there, looks to be configured just > fine. No reason you should get a "no route matches" error, that I can see. > In development mode you shouldn't even need to restart the server, but you > could always try that. > > From what you've posted so far, I can't see that you're doing anything > wrong. Not sure why it wouldn't be working. > > >> > >> >> >> >> Thanks a lot in advance. >> >> >> >> >> -- >> Leonardo Mateo. >> There's no place like ~ >> >> -- >> 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. >> >> > -- > 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. > -- 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.

