405 Error when trying to POST a file in rails

亡梦爱人 提交于 2019-12-02 01:06:44

The first thing that comes to my attention is that you have a route at /assets, which is normally reserved to the Rails asset pipeline. Rails is known to be not very informative about reporting problems with this (see issue 10132 and issue 19996 on rails core).

Try moving your asset pipeline to another mount point, and see if that fixes your problem. This can be accomplished by setting Rails.application.config.assets.prefix to something other than /assets. For example in config/initializers/assets.rb add the line:

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