Skip to content

Instantly share code, notes, and snippets.

@aanand
Created September 1, 2010 21:26
Show Gist options
  • Save aanand/561397 to your computer and use it in GitHub Desktop.
Save aanand/561397 to your computer and use it in GitHub Desktop.
[69, 78] in {...}/gems/actionpack-3.0.0.rc/lib/action_controller/metal/renderers.rb
69 INCLUDED.each(&:_write_render_options)
70 end
71 end
72
73 add :json do |json, options|
=> 74 json = ActiveSupport::JSON.encode(json, options) unless json.respond_to?(:to_str)
75 json = "#{options[:callback]}(#{json})" unless options[:callback].blank?
76 self.content_type ||= Mime::JSON
77 self.response_body = json
78 end
{...}/gems/ruby-1.9.2-p0@idrc-tti/gems/actionpack-3.0.0.rc/lib/action_controller/metal/renderers.rb:74
json = ActiveSupport::JSON.encode(json, options) unless json.respond_to?(:to_str)
(rdb:1) json
#<Mongoid::Criteria:0x10ff2fc @selector={:institution_ids=>BSON::ObjectID('4c7ec04af01540042700000d')}, @options={:sort=>[[:_id, :asc]]}, @klass=Story, @documents=[]>
(rdb:1) options
{:prefix=>"institutions", :template=>"stories", :layout=>"layouts/application"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment