ActionController :: Response_with的UnknownFormat

时间:2014-01-10 06:36:43

标签: ruby-on-rails

我已经回到我的ruby on rails项目,发现我得到了:

ActionController::UnknownFormat

错误代码非常简单:

    respond_with(allMatches)

allMatches哈希定义为:

        allMatches = {  "matchesProposed"   => proposedMatchAndNeedsActionObjects,
                        "matchesReceived"   => receivedMatchAndNeedsActionObjects,
                        "scheduledMatches"  => scheduledMatches}

我已在班级宣布:

class HomeController < ApplicationController

  respond_to :json

代码运行正常,直到今天 - 没有变化!有什么想法吗?

1 个答案:

答案 0 :(得分:2)

如果请求的格式未在ActionController::UnknownFormatrespond_to中指定,则会引发错误respond_with

由于您没有提供任何进一步的信息,只提供最少的代码示例,因此您必须保留digging yourself