Publify 是目前满足我需求的完美宝石,但我不知道如何将其移动到“/blog”。
我改为root "articles#index
,get "/blog", to: "articles#index"
但应用程序中对根路径的所有内部引用都导致了错误的位置。
我怎样才能正确地实现我想要实现的目标?
Publify 是目前满足我需求的完美宝石,但我不知道如何将其移动到“/blog”。
我改为root "articles#index
,get "/blog", to: "articles#index"
但应用程序中对根路径的所有内部引用都导致了错误的位置。
我怎样才能正确地实现我想要实现的目标?
方法是添加config.relative_url_root = "/blog"
到 application.rb 文件。在rails 指南中查看更多信息。
另一种想法是让应用程序保持原样,并使用 webserver/passenger 在子目录中运行它。
您可以尝试以下方法:
root "articles#index"
get "/blog" => redirect("/")