user984621
user984621

Reputation: 48493

Rails - MissingTemplate occurred in controller#action

I have following scheme:

click on this link

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

go to ArticlesController

  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  

then is called articles/info_form.js.haml

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

and _info.html.haml

here is a form

This is the flow of actions in my app and it's working great. But in the production, several times a day I am getting this error messages:

A ActionView::MissingTemplate occurred in articles#info_form: 

Missing template articles/info_form, application/info_form with

In the log is following:

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)

The URL which gives this errors is the URL, which is visited by google bot. How can I fix this error? Because, the problematic URL is not clickable for the "usual" users, giving the error just that time, when Google bot visit it...

Upvotes: 1

Views: 500

Answers (1)

rado
rado

Reputation: 2573

Do you have HTML view of that action?

info_form.html.haml

Upvotes: 2

Related Questions