Question

When I curl or another server calls my server it interprets the format as */*. Since I've installed jbuilder it always repsonds with json.

How can I adjust the preference order for formats to respond to */*.

Was it helpful?

Solution

The problem had to do with the respond_to action.

With an action that has:

respond_to do |fmt|
  fmt.json
  fmt.html
end

Any request of type */* will be json.

To make it html you just need to make it the first format that's responded to:

respond_to do |fmt|
  fmt.html
  fmt.json
end
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top