1

我有以下方案:

点击这个链接

= link_to 'Ping', {:controller => 'articles', :action => 'info_form', :to_article => @article.id}

转到文章控制器

  def info_form
    @info = current_user unless current_user.nil?
    @to_article_id = Article.find(params[:to_article])

    respond_to do |format|
      format.html {}
      format.js 
     end
  end  

然后被称为articles/info_form.js.haml

$('#article_form').html("#{escape_javascript(render('info'))}");
$('#article_form_window').modal('toggle');

_info.html.haml

here is a form

这是我的应用程序中的操作流程,效果很好。但在生产中,我每天多次收到以下错误消息:

A ActionView::MissingTemplate occurred in articles#info_form: 

Missing template articles/info_form, application/info_form with

日志中如下:

Request: 
* URL : http://web.com/articles/info_form?to_article=37
* HTTP_FROM : googlebot(at)googlebot.com
* HTTP_USER_AGENT : Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)

给出此错误的 URL 是由 google bot 访问的 URL。我该如何解决这个错误?因为,有问题的 URL 对于“普通”用户来说是不可点击的,当谷歌机器人访问它时,就会出现错误......

4

1 回答 1

2

你有那个动作的 HTML 视图吗?

info_form.html.haml

于 2012-07-21T20:55:21.480 回答