我正在尝试使用Spree Static Content将一个aboutUs页面添加到一个狂欢应用程序中。当我点击“关于我们”页面
的链接时出现以下错误我有以下布局
布局/ aboutUs.html.erb
在routes.rb文件中,我有以下代码。
Rails.application.routes.draw do
# This line mounts Spree's routes at the root of your application.
# This means, any requests to URLs such as /products, will go to Spree::ProductsController.
# If you would like to change where this engine is mounted, simply change the :at option to something different.
#
# We ask that you don't use the :as option here, as Spree relies on it being the default of "spree"
mount Spree::Core::Engine, at: '/'
# For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html
get 'Yellow', to: 'static_pages#aboutUs'
end
答案 0 :(得分:0)
我知道来晚了,您也许很早就解决了问题,但是对于那些来这里寻找答案的人来说。
问题出在使用/layout
而不是/static_content
。
如果您使用的是控制器,并且该方法内部未使用特定路线进行渲染,则应使用预定义的路线来放置渲染文件。
快速解答:
将aboutUs.html.erb
文件放置在/static_content
而不是/layout
处,具有以下文件位置:
{app_route} /static_content/aboutUs.html.erb