用浏览器部分教程打开/ public的文件?

时间:2014-03-11 21:14:00

标签: ruby-on-rails ruby

在我关注的教程中,它告诉我以下内容:

In the terminal you can run

    $ ruby page_generator.rb

This will loop through all the files in the `views` directory, parse their erb and write the contents to the `public` directory.

Run the generator and drag a page from the `public` directory to your browser, it should render.

当我运行

$ ruby page_generator.rb 

我明白了:

================================================
=== Converting files in /views to html =========
================================================
- Reading views/index.html.erb
  - Converting .html.erb to html
  - Writing public/index.html
- Reading views/me.html.erb
  - Converting .html.erb to html
  - Writing public/me.html
================================================
=== Done, open files in /public with browser ===
================================================

我不确定"用浏览器打开/ public中的文件"手段?我试过拖动,运行服务器(localhost),不确定我应该怎样做才能让它在浏览器上呈现?对教程试图告诉我做什么的任何见解?

1 个答案:

答案 0 :(得分:0)

它应该引用位于Rails应用程序根文件夹内的public/文件夹;试着看看那里