在升级到 Rails 3.1.0 并按照David Rice 的指示后,我所有的控制器都奇怪地找不到他们的视图了。
# rails s #
Started GET "/units" for 127.0.0.1 at 2011-09-04 07:52:23 -0400
Unit Load (0.1ms) SELECT "units".* FROM "units"
ActionView::MissingTemplate (Missing template units/index, application/index with {:handlers=>[:erb, :builder], :formats=>[:html], :locale=>[:en, :en]}. Searched in:
):
app/controllers/units_controller.rb:9:in `index'
units_controller.rb
:
# GET /units
# GET /units.xml
def index
@units = Unit.all
respond_to do |format|
format.html # index.html.erb
format.xml { render :xml => @units }
end
end
当然,视图在那里(/app/views/units/index.html.erb
; 它在升级之前工作)。我觉得这是一个愚蠢的错误,我在这里错过了什么?