按照网上的参考,http://guides.ruby.tw/rails3/getting_started.html 1.删除,delete public/index.html,我已操作完毕了 2.生成 rails generate controller home index 3.修改 route,我的如下
# Sample resource route within a namespace: # namespace :admin do # # Directs /admin/products/* to Admin::ProductsController # # (app/controllers/admin/products_controller.rb) # resources :products # end
# You can have the root of your site routed with "root" # just remember to delete public/index.html. root :to => "home#index"
而我的 index 页面如下: [Crabby@Crabby-Lee home]$ more index.html.erb
<%= link_to "My Blog",posts_path %>
Find me in app/views/home/index.html.erb
[Crabby@Crabby-Lee home]$ pwd /home/Crabby/weblog/app/views/home
我已重启了 server WEBrick,但是还是没有生效,咋回事儿呀,没法进行下一步了~