Rick wrote: > On one of my new.html.erb files backed by a "matches_controller" I'm > getting the error: > > undefined method `matches_path' for #<ActionView::Base:0x2cfc748> > > I don't understand where to start looking to try to understand why I'm > getting this error. Even if I back everything out of the page and just > have: > > <h1>New match</h1> > <% form_for(@match) do |f| %> > <% end %> > > I still get the error. > > What am I supposed to do to start tracking now where the issue is? Is > it that I'm getting an error message that isn't directly related at > all to the 'matches_path" issue. > Other pages aren't having this issue, so I'm a bit stumped.
I'm still a relative newby, so no worries :) It's a routing problem. The form_for tries to generate a route relating to the matches controller, but the route doesn't exist. Either you want to add something like map.resources :matches to config/routes.rb, or manually add a route in that same file, pointing to the controller/action you want. The resources mapping will generate a whole load of routes for that controller that use the RESTful principles. You can add that above line and then run "rake routes" to list the structure. The new routes generate buy the line will be shown and should let you see what it does. HTH Matt --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---

