Skip to content

Instantly share code, notes, and snippets.

@chakrit
Created December 23, 2011 09:13
Show Gist options
  • Save chakrit/1513684 to your computer and use it in GitHub Desktop.
Save chakrit/1513684 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(x)
"{ 'test': #{pong} }"
end
end
def ping
render json: Pong.new
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment