在过去的几天里,当谷歌机器人试图访问我们的主页(欢迎/索引)时,我们已经开始收到丢失的模板错误.我一直盯着这几个小时,知道我只是缺少一些简单的东西.
A ActionView::MissingTemplate occurred in welcome#index:
Missing template welcome/index with {:handlers=>[:erb, :rjs, :builder, :rhtml, :rxml, :haml], :formats=>["*/*;q=0.9"], :locale=>[:en, :en]}
Run Code Online (Sandbox Code Playgroud)
但模板确实存在(index.html.haml).如果没有,没有人可以访问我们的主页.
以下是一些其他环境信息:
* REMOTE_ADDR : 66.249.72.139
* REMOTE_PORT : 56883
* REQUEST_METHOD : GET
* REQUEST_URI : /
* Parameters: {"controller"=>"welcome", "action"=>"index"}
Run Code Online (Sandbox Code Playgroud)
您将获得任何见解将不胜感激.
我已经安装了Visual Studio 2015 Preview.
现在我尝试从Add New Item Dialog创建新报告(.rdlc)
但是我无法在"添加新项目向导"中查看报告模板选项,下面是我的问题的图像:

任何人都可以帮我如何在添加新项目向导中添加报告模板
提前致谢
GO先生
升级到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'
Run Code Online (Sandbox Code Playgroud)
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
Run Code Online (Sandbox Code Playgroud)
当然,视图在那里(/app/views/units/index.html.erb;它在升级之前工作).我觉得这是一个愚蠢的错误,我在这里错过了什么?
我希望你能帮助我弄清楚为什么我会得到这个特殊的错误.
我有以下表格:
<%= form_for :response, :url => {:action => 'create'}, :remote => true do |f| %>
<%= f.hidden_field :template_id, :value => @template.id %>
<%= button_tag(type: 'submit', class: "btn btn-primary btn-lg pull-right next-slide") do %>
Next →
<% end %>
<% end %>
Run Code Online (Sandbox Code Playgroud)
def create
@response = Response.new(response_params)
respond_to do |format|
if @result = @response.save
format.html
format.js
else
format.html { render :action => "new" }
format.js
end
end
end
Run Code Online (Sandbox Code Playgroud)
<% if @result %>
alert("Success!");
<% else %> …Run Code Online (Sandbox Code Playgroud) 嗨,我是Ruby on Rails的新手,我正在网上关注Michael Hartl的书.在局部模板他的书的部分.他用来渲染部分的代码是
<%= render 'layouts/stylesheets' %>
但是我得到了这个错误.
我读了API并尝试了这个
<%=render :partial => "/layouts/stylesheets" %>但仍然无法想象这一个.
感谢您的帮助!
render actionview partials missing-template ruby-on-rails-3.2
如何在Rails中捕获ActionView :: MissingTemplate错误?
例如,我PeopleController有一个Index方法,但它不需要模板.当有人浏览root_url/people时,他们会获得默认的静态错误模板.
而且这不是唯一有问题的控制器; 我希望所有丢失的模板错误将用户重定向到我的自定义视图.
Rails版本 - 3.0.19
提前致谢!