Skip to content

Instantly share code, notes, and snippets.

@chakrit
Created December 23, 2011 09:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chakrit/1513680 to your computer and use it in GitHub Desktop.
Save chakrit/1513680 to your computer and use it in GitHub Desktop.
class ApiController < ApplicationController
respond_to :json
class Pong < Object
attr_accessor :pong
def initialize
@pong = true
end
def to_json(w)
"{ 'test': true }"
end
end
def ping
respond_with(Pong.new)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment