当我请求 rails 服务器时,如何访问指令文件?

when I request rails server, how to access directive file?

例如, 我有 url“http://10.0.0.1:3000/image/a.jpg”。 所以我用 url.

请求 rails 服务器

但 rails 服务器使用 url(例如 "protocol://ip/controller/action.")。

如何指令访问“http://10.0.0.1.:3000/image/a.jpg”?

您可以将 a.jpg 放在 public 文件夹中,因此 Rails 文件路径应为 <rails_root>/public/image/a.jpg.

当您访问 Rails 应用程序时,localhost:3000/image/a.jpg 应该正在加载您的图片。