之前的index页,显示的是hello world,现在将其修改为显示我们在rails console里面录入的数据. 1. 修改action 如之前的章节<[ruby on rails] 跟我学之路由映射>里面介绍的,修改app/controllers/posts_controller.rb 的index方法,如下: def index @posts = Post.all end 2. 修改view 并修改app/views/posts/index.html.erb 这个view文件,如下:…