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

后端 未结 2 867
伪装坚强ぢ
伪装坚强ぢ 2021-01-27 20:13

I\'m reading through Hartl\'s book, Ruby on Rails by Example. In chapter 11, it has you implement delete requests to allow users to delete microposts on their profile. However w

相关标签:
2条回答
  • 2021-01-27 20:43

    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

    0 讨论(0)
  • 2021-01-27 20:43

    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.

    0 讨论(0)
提交回复
热议问题