The url ([myurl.com]/goals/13) looks like one of the new
“resource-based” urls from Rails 1.2, but it seems like the routing
system is expecting an old-style url ([myurl.com]/goals/destroy/13). If
you are using the new routing then it seems like you’ve somehow mixed up
the two systems. I don’t know much about the new system, but I know that
if you’re using it you should have a line like the following in your
routes.rb file:
map.resources :goals
Do you have this?
I you still can’t figure out the problem, please post your routes.rb
file - it might provide some more clues about what’s going wrong.
Thanks so much for your reply. I think I do have a mix of routing
systems, but I’m not sure how it works. Does rails have a doc outlining
how routes in 1.2 works? here’s my config/routes.rb file:
ActionController::Routing::Routes.draw do |map|
map.resources :goals_tags
map.resources :tags
map.resources :goals
map.connect ‘’, :controller => “goals”
The priority is based upon order of creation: first created ->
This appears to be the preferred way of writing links with the new
routing - it may be the only way. Don’t ask me how it works though - I
haven’t worked it out yet myself.
There does appear to be some “hidden” documentation for this in the
“resources.rb” file in the rails source. For some reason it’s marked
with a #:nodoc: tag, so it doesn’t appear in the generated
documentation. I don’t know whether this was just an oversight or
whether the documentation is not considered satisfactory.
my URL:
referenced in my view?
I’m guessing you’re mapping ‘goals’ as a resource in your routes.rb
file? If so, you’ll need to specify the ‘delete’ method explicitly. Try:
There does appear to be some “hidden” documentation for this in the
“resources.rb” file in the rails source. For some reason it’s marked
with a #:nodoc: tag, so it doesn’t appear in the generated
documentation. I don’t know whether this was just an oversight or
whether the documentation is not considered satisfactory.