简体   繁体   English

ActionController :: UnknownFormat用于response_with

[英]ActionController::UnknownFormat for respond_with

I have returned to my ruby on rails project to find that I am getting: 我返回到我的ruby on rails项目,发现我得到了:

ActionController::UnknownFormat

error for a very simple line of code: 错误的非常简单的代码行:

    respond_with(allMatches)

The allMatches hash is defined as: allMatches哈希定义为:

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

I have declared at the class level: 我已经在班级声明:

class HomeController < ApplicationController

  respond_to :json

The code has been functioning just fine, until today - no changes! 该代码一直运行良好,直到今天-无需更改! Any thoughts? 有什么想法吗?

The error ActionController::UnknownFormat is raised when there is a request in a format that is not specified in respond_to or respond_with . 错误ActionController::UnknownFormat当存在未指定的格式中的请求被升高respond_torespond_with

Since you did not provide any further information and just minimal code examples, you will have to keep digging yourself . 既然你没有提供任何进一步的信息,只是最少的代码示例,您将不得不继续挖掘自己

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 当我使用respond_to + respond_with时,ActionController :: UnknownFormat(Rails 4) - ActionController::UnknownFormat when I use respond_to + respond_with (Rails 4) Rails 4.1 ActionController ::使用AngularJS的respond_with的UnknownFormat错误 - Rails 4.1 ActionController::UnknownFormat error for respond_with using AngularJS 使用Backbone.js的ActionController :: UnknownFormat response_with - ActionController::UnknownFormat respond_with using Backbone.js response_to:json ActionController :: UnknownFormat - respond_to :json ActionController::UnknownFormat 带AJAX的response_to js的ActionController :: UnknownFormat - ActionController::UnknownFormat with respond_to js for AJAX 响应于响应的 Rails ActionController::UnknownFormat 错误 - Rails ActionController::UnknownFormat error with respond_to 在Action:Create中使用带有response_to js的ActionController :: UnknownFormat - ActionController::UnknownFormat with respond_to js in Action:Create Rails respond_to 抛出 ActionController::UnknownFormat - Rails respond_to throw ActionController::UnknownFormat 使用和测试Rails ActionController的respond_with - Working with and Testing Rails ActionController's respond_with ActionController :: UnknownFormat(ActionController :: UnknownFormat) - ActionController::UnknownFormat (ActionController::UnknownFormat)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM