【问题标题】:How to change root in RefineryCMS to blog?如何将 RefineryCMS 中的 root 更改为博客?
【发布时间】:2023-03-14 00:05:01
【问题描述】:

在我的config/routes.rb 我有以下内容

Myapp::Application.routes.draw do

  # We ask that you don't use the :as option here, as Refinery relies on it being the default of "refinery"
  mount Refinery::Core::Engine, :at => '/'

  # You can have the root of your site routed with "root"
  # just remember to delete public/index.html.
  root :to => 'refinery/blog/posts#index'

  # See how all your routes lay out with "rake routes"

end   

我在终端中运行了rake routes。然后承诺并推动。然后运行heroku run rake routes,但是当我加载应用程序时,它仍然以root身份加载主页。

【问题讨论】:

    标签: ruby-on-rails heroku refinerycms


    【解决方案1】:

    将您的路由放在 Refinery 的挂载点之前,因为 Refinery 有一个通配符路由,因此它可以处理 404 并且基本上是您的应用程序的支持。所以,一般来说,每隔一条路线就安装 Refinery。

    【讨论】:

    • 好的,谢谢,那行得通。但是在所有自定义路线之后需要重复吗?有没有可以浏览的routes.rb 示例?
    • 其余的过程是否正常,或者是否有可以消除的步骤?
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-03-05
    • 1970-01-01
    • 2018-10-26
    • 1970-01-01
    • 2020-06-19
    相关资源
    最近更新 更多