0
votes

I have the following in routes.rb:

  resource :account, :controller => "accounts"
  resources :accounts

this redirect is in a controller:

  redirect_to account_url

and when this redirect is called, I get the following error:

Routing Error

No route matches {:action=>"destroy", :controller=>"accounts"}

The following are displayed when running rake routes:

...
...
accounts DELETE /accounts(.:format) {:action=>"destroy", :controller=>"accounts"}
...
...
account DELETE /accounts/:id(.:format) {:action=>"destroy", :controller=>"accounts"}
...
...

So it seems to me that I've got the {:action=>"destroy", :controller=>"accounts"} covered -> according to rake routes anyways. Anyone have an idea as to what I'm doing wrong?

1

1 Answers

0
votes

What's that first route's intention? It should be enough with the second one to map HTTP verbs to controller actions automatically.