Spa*_*nce 6 html iframe ruby-on-rails
我有一个 Rails 应用程序页面,我想将其用作不同网页上的 iframe。我的 rails 应用程序的一部分是new我的score对象的视图。目前我的 rails 应用程序只是在本地托管。为了测试我的 iframe,我在publicRails 应用程序的文件夹中有一个 HTML 页面。
这是test.html页面
<html>
<iframe width="400" height="400" src="scores/new?site_id=191">
</iframe>
</html>
Run Code Online (Sandbox Code Playgroud)
但是,这不起作用。这是我检查 iframe 时得到的错误
GET file:///Users/spencerhanson/Documents/Projects/net-promoter-score/public/scores/new?site_id=191 net::ERR_FILE_NOT_FOUND
我知道 public/scores/new/.. 不是我的项目中存在的地方。我不明白为什么它试图看那里。该test.html文件在/public/目录中。这里的事情是,我以前有过这个工作,src在我的 iframe 中使用相同的标签。我没有改变任何东西,然后有一天 iframe 停止在我的测试页面上工作。我无法弄清楚出了什么问题。我知道这可能src是我的 iframe的标签,因为我试图在一个也是本地的页面上显示本地托管的站点