添加关于页面的狂欢静态页面路由问题

时间:2016-11-16 20:46:44

标签: ruby-on-rails ruby spree

我正在尝试使用Spree Static Content将一个aboutUs页面添加到一个狂欢应用程序中。当我点击“关于我们”页面enter image description here

的链接时出现以下错误

我有以下布局

  

布局/ 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

1 个答案:

答案 0 :(得分:0)

我知道来晚了,您也许很早就解决了问题,但是对于那些来这里寻找答案的人来说。

问题出在使用/layout而不是/static_content

如果您使用的是控制器,并且该方法内部未使用特定路线进行渲染,则应使用预定义的路线来放置渲染文件。

快速解答:  将aboutUs.html.erb文件放置在/static_content而不是/layout处,具有以下文件位置:

  

{app_route} /static_content/aboutUs.html.erb