Rails3:如何将我的应用程序的根目录设置为application #index?

时间:2011-01-27 16:13:52

标签: ruby-on-rails ruby-on-rails-3 routing

我有views/application/index.html.erb

在我的路线文件中我有:

  root :to => "application#index"

我的ApplicationController如下:

class ApplicationController < ActionController::Base
  protect_from_forgery

  def index
    # ask whether teh player wants to go first or second
    @player_start_character = ""

      end
end

但是当我导航到localhost:3000时,它仍然说“你刚刚启动了一个rails app项目”页面

我也删除了public / index.html

1 个答案:

答案 0 :(得分:6)

您必须删除/public/index.html文件