Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ruby-on-rails/60.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails Spree AJAX API调用404';由于错误的基本URL而导致的错误_Ruby On Rails_Spree - Fatal编程技术网

Ruby on rails Spree AJAX API调用404';由于错误的基本URL而导致的错误

Ruby on rails Spree AJAX API调用404';由于错误的基本URL而导致的错误,ruby-on-rails,spree,Ruby On Rails,Spree,因此,我目前在RubyonRails上的Spree中从动态加载字段中得到404个错误 我已经检查了我的rake路由,以确保API路由存在,它是 但是,我在config/routes.rb中的不同基本URL下安装了Spree引擎 mount Spree::Core::Engine,位于:'/shop' 因此,总的来说,动态加载字段查询API时使用: http:///api/v1/states?country_id=232 而不是http:///shop/api/v1/states?country_

因此,我目前在RubyonRails上的Spree中从动态加载字段中得到404个错误

我已经检查了我的
rake路由
,以确保API路由存在,它是

但是,我在config/routes.rb中的不同基本URL下安装了Spree引擎

mount Spree::Core::Engine,位于:'/shop'

因此,总的来说,动态加载字段查询API时使用:
http:///api/v1/states?country_id=232
而不是
http:///shop/api/v1/states?country_id=232

是否需要向routes.rb文件中添加额外的路由?还是更险恶的


谢谢。

结果是缓存问题

通过将spree引擎安装点设置为根路径进行修复

mount Spree::Core::Engine,位于:'/'

然后通过管理面板刷新spree缓存