Skip to content

Instantly share code, notes, and snippets.

@stve
Created June 10, 2010 17:36
Show Gist options
  • Select an option

  • Save stve/433335 to your computer and use it in GitHub Desktop.

Select an option

Save stve/433335 to your computer and use it in GitHub Desktop.
if request.accept.include?('application/json')
content_type :json
else
content_type :text
end
class Struct
def to_json(*args)
hash.to_json(*args)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment