Micropost - Routing Error No route matches [GET] - Deleting a Micropost

北战南征 提交于 2019-12-02 08:51:49

It's a Rails 3.1 issue. Look at your page header -- instead of jquery, it's trying to load "defaults.js," which doesn't exist.

http://ruby.railstutorial.org/chapters/rails-3-1#code:layout_rails_3_1_diff

You should add :method => :delete to trigger delete action. If you have this code in your view and its not working, than my guess is that you either don't have the necessary javascript files in your project (jquery.js and rails.js/jquery_ujs.js) or you are not including them in your layout. If this is not help you show us your routes and view.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!