0

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 */*.

Tal
  • 1,298
  • 2
  • 10
  • 20

1 Answers1

1

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
Tal
  • 1,298
  • 2
  • 10
  • 20