我使用了脚手架来生成简单的应用程序,我可以通过名为"PostMan“的铬扩展工具执行GET和POST,但是我无法通过这个工具执行删除操作,我得到:
No route matches [DELETE] "/settings.json/18"我查过routes.rb了
Rails.application.routes.draw do
resources :settings只有在执行API调用时,才能通过默认的脚手架删除记录。
控制台日志显示以下内容:
ActionController::RoutingError (No route matches [DELETE] "/settings.json/18"):
actionpack (4.2.5) lib/action_dispatch/middleware/debug_exceptions.rb:21:in `call'
web-console (2.3.0) lib/web_console/middleware.rb:20:in `block in call'
web-console (2.3.0) lib/web_console/middleware.rb:18:in `catch'我不知道还需要检查什么,任何输入都是非常合适的。
发布于 2016-03-23 13:29:22
路径有问题,应该是"/settings/18.json"而不是"/settings.json/18"。
希望这能帮上忙!
https://stackoverflow.com/questions/36179529
复制相似问题