ruby-on-rails – Rails 3.1升级后的ActionView :: MissingTemplate

升级到Rails 3.1.0和 David Rice’s instructions之后,我的所有控制器都奇怪地找不到他们的意见了.
# 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;它在升级之前工作).我觉得这是一个愚蠢的错误,我在这里错过了什么?

解决方法

您好像忘记在development.rb中删除以下行:

config.action_view.debug_rjs = true

不使用Rail Javascript时,应将其删除或注释掉.

有关升级的更多信息,请参阅rubyonrails.org上的“jQuery:New Default”
http://weblog.rubyonrails.org/2011/4/21/jquery-new-default

相关文章

validates:conclusion,:presence=>true,:inclusion=>{...
一、redis集群搭建redis3.0以前,提供了Sentinel工具来监控各...
分享一下我老师大神的人工智能教程。零基础!通俗易懂!风趣...
上一篇博文 ruby传参之引用类型 里边定义了一个方法名 mo...
一编程与编程语言 什么是编程语言? 能够被计算机所识别的表...
Ruby类和对象Ruby是一种完美的面向对象编程语言。面向对象编...