gpt4 book ai didi

html - 如何使用 Rails 提供静态 html 页面?

转载 作者:太空宇宙 更新时间:2023-11-03 21:32:23 25 4
gpt4 key购买 nike

我有一个带有文档的 Rails 应用程序,它是/public 文件夹中的静态 html 页面。

我的公共(public)文件夹的树:

-public
-docs
-intro
introduction.html
-css
some.css
index.html

Index.html 文件是:

<link rel="stylesheet" href="css/some.css" type="text/css" />
Some of the text
<li>href="intro/introduction.html"><em>Introduction</em></a></li>

当我打开索引页面时,CSS 未加载,当我尝试单击链接时,它显示路由错误。据我了解,静态页面不知道在哪里寻找 css 和其他 html 页面。

我只想要没有任何路由和 Controller 的静态页面,nginx。

有什么想法吗?

最佳答案

所有公共(public)文件夹内容都可以通过“/”访问

<link rel="stylesheet" href="/docs/css/some.css" type="text/css" />

您可以使用 high_voltage gem生成静态页面

关于html - 如何使用 Rails 提供静态 html 页面?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28608656/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com