ActionController ::仅在Heroku上的UnknownFormat

时间:2017-06-09 05:04:56

标签: ruby-on-rails heroku

在heroku日志中,我看到以下内容。

app[web.1]: Started GET "/tags/1" ...
app[web.1]: Processing by TagsController#show as HTML
app[web.1]:   Parameters: {"id"=>"1"}
app[web.1]:   Tag Load (1.2ms)  SELECT  "tags".* FROM "tags" WHERE "tags"."id" = $1 LIMIT $2  [["id", 1], ["LIMIT", 1]]
app[web.1]: Completed 406 Not Acceptable in 7ms (ActiveRecord: 1.2ms)
app[web.1]: ActionController::UnknownFormat (TagsController#show is missing a template for this request format and variant.
app[web.1]: request.formats: ["text/html"]
app[web.1]: request.variant: []

在开发环境中,页面呈现正常,我没有看到错误。

> ls app/views/tags
_form.html.haml new.html.haml   show.html.haml

控制器

class TagsController < ApplicationController
  before_action :authenticate_user!, except: :show

  def show
    @tag = Tag.find(params[:id].to_i)
  end
  ...

0 个答案:

没有答案