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

Nul*_*uli 4 routing ruby-on-rails ruby-on-rails-3

我有 views/application/index.html.erb

在我的路线文件中我有:

  root :to => "application#index"
Run Code Online (Sandbox Code Playgroud)

我的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
Run Code Online (Sandbox Code Playgroud)

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

我也删除了public/index.html

Mau*_*cio 6

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