简体   繁体   中英

ActionController::UnknownFormat for respond_with

I have returned to my ruby on rails project to find that I am getting:

ActionController::UnknownFormat

error for a very simple line of code:

    respond_with(allMatches)

The allMatches hash is defined as:

        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 .

Since you did not provide any further information and just minimal code examples, you will have to keep digging yourself .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM