0

I want to call a destroy action. It is already define in controller. The model that I want to destroy is nested resource. But route is existing in rake routes result.

  new_content_model GET    /contents/:content_id/model/new(.:format)                         {:controller=>"models", :action=>"new"}
 edit_content_model GET    /contents/:content_id/model/:id/edit(.:format)                    {:controller=>"models", :action=>"edit"}
      content_model PUT    /contents/:content_id/model/:id(.:format)                         {:controller=>"models", :action=>"update"}
                    DELETE /contents/:content_id/model/:id(.:format)                         {:controller=>"models", :action=>"destroy"}

And I call destroy action from this url

<%= link_to "destroy nested model", content_model_path( @content.id, @model.id ), :confirm => "are you sure?", :method => :delete %>

It is no route matches.

Routing Error
No route matches "/contents/1/model/1"`

Please tell me some solutions.


Already wrote <%= javascript_include_tag :all %> in layouts/application.html.erb

Rails 3 link_to (:method => :delete) not working

Community
  • 1
  • 1
inohiro
  • 285
  • 1
  • 3
  • 17
  • I can't see anything obviously wrong. The next thing I would do is look at the log after trying to follow the link, and see if that reveals anything useful. – Steve Jorgensen Apr 02 '11 at 20:04

1 Answers1

1

I solved this problem. It was wrong that I deleted rails.js and prototype.js.

Thank you for your attending. Sorry for lack of information.

inohiro
  • 285
  • 1
  • 3
  • 17