Skip to content

Instantly share code, notes, and snippets.

@stevez
Created October 22, 2012 00:38
Show Gist options
  • Select an option

  • Save stevez/3929094 to your computer and use it in GitHub Desktop.

Select an option

Save stevez/3929094 to your computer and use it in GitHub Desktop.
def request_json
@response['headers']['Content-Type']='application/json'
obj = {"a" => 1, "b"=> 2}
result = obj.to_json
render :string => result, :use_layout_on_ajax => true
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment