<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Better JSON output from Rails with the Jsonifier plugin</title>
	<atom:link href="http://blog.codefront.net/2007/07/11/better-json-output-from-rails-with-the-jsonifier-plugin/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.codefront.net/2007/07/11/better-json-output-from-rails-with-the-jsonifier-plugin/</link>
	<description>Rails, Firefox, Anime, Mac</description>
	<lastBuildDate>Thu, 11 Mar 2010 23:55:41 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: fb</title>
		<link>http://blog.codefront.net/2007/07/11/better-json-output-from-rails-with-the-jsonifier-plugin/comment-page-1/#comment-544715</link>
		<dc:creator>fb</dc:creator>
		<pubDate>Fri, 28 Mar 2008 02:34:03 +0000</pubDate>
		<guid isPermaLink="false">http://blog.codefront.net/2007/07/11/better-json-output-from-rails-with-the-jsonifier-plugin/#comment-544715</guid>
		<description>I also get the “wrong number of arguments (1 of 0)” error when I try to use any arguments. This happens if I use rails 1.8.6. But everything is fine when I use rails 2.0.1. Can somebody help me please? I need to make this work under 1.8.6. Thanks!</description>
		<content:encoded><![CDATA[<p>I also get the “wrong number of arguments (1 of 0)” error when I try to use any arguments. This happens if I use rails 1.8.6. But everything is fine when I use rails 2.0.1. Can somebody help me please? I need to make this work under 1.8.6. Thanks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: brian</title>
		<link>http://blog.codefront.net/2007/07/11/better-json-output-from-rails-with-the-jsonifier-plugin/comment-page-1/#comment-531164</link>
		<dc:creator>brian</dc:creator>
		<pubDate>Sat, 15 Mar 2008 18:46:15 +0000</pubDate>
		<guid isPermaLink="false">http://blog.codefront.net/2007/07/11/better-json-output-from-rails-with-the-jsonifier-plugin/#comment-531164</guid>
		<description>I want to be able to provide a link in a page via a third party application that will call back to my site and post data.  Javascript gets caught in the cross browser issue.  I see examples where Json can pull data back via cross-browser, but how do you pull page a link, that could POST data back to the server site if clicked?  Are their any good examples of doing this?</description>
		<content:encoded><![CDATA[<p>I want to be able to provide a link in a page via a third party application that will call back to my site and post data.  Javascript gets caught in the cross browser issue.  I see examples where Json can pull data back via cross-browser, but how do you pull page a link, that could POST data back to the server site if clicked?  Are their any good examples of doing this?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Software As She&#8217;s Developed &#187; Blog Archive &#187; Rails JSON, JSON Rails</title>
		<link>http://blog.codefront.net/2007/07/11/better-json-output-from-rails-with-the-jsonifier-plugin/comment-page-1/#comment-509367</link>
		<dc:creator>Software As She&#8217;s Developed &#187; Blog Archive &#187; Rails JSON, JSON Rails</dc:creator>
		<pubDate>Sat, 23 Feb 2008 19:00:28 +0000</pubDate>
		<guid isPermaLink="false">http://blog.codefront.net/2007/07/11/better-json-output-from-rails-with-the-jsonifier-plugin/#comment-509367</guid>
		<description>[...] I just discovered this extremely helpful library - Jsonifier, which also ships as a Rails plugin. It deals with both of the above problems. There&#039;s no [...]</description>
		<content:encoded><![CDATA[<p>[...] I just discovered this extremely helpful library &#8211; Jsonifier, which also ships as a Rails plugin. It deals with both of the above problems. There&#8217;s no [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: alex</title>
		<link>http://blog.codefront.net/2007/07/11/better-json-output-from-rails-with-the-jsonifier-plugin/comment-page-1/#comment-294719</link>
		<dc:creator>alex</dc:creator>
		<pubDate>Wed, 03 Oct 2007 18:34:05 +0000</pubDate>
		<guid isPermaLink="false">http://blog.codefront.net/2007/07/11/better-json-output-from-rails-with-the-jsonifier-plugin/#comment-294719</guid>
		<description>I&#039;m confused.... So, before I add jsonifier. I get output with the &#039;attributes&#039; tag. I add jsonifier and now I get an error that &quot;object references iitself&quot; from the same controller def that just worked. No other changes. All the controller does is:
&lt;code&gt;
    @projects = Project.find(:all)
    render :text =&gt; @projects.to_json
&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>I&#8217;m confused&#8230;. So, before I add jsonifier. I get output with the &#8216;attributes&#8217; tag. I add jsonifier and now I get an error that &#8220;object references iitself&#8221; from the same controller def that just worked. No other changes. All the controller does is:<br />
<code><br />
    @projects = Project.find(:all)<br />
    render :text =&gt; @projects.to_json<br />
</code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tim</title>
		<link>http://blog.codefront.net/2007/07/11/better-json-output-from-rails-with-the-jsonifier-plugin/comment-page-1/#comment-291098</link>
		<dc:creator>Tim</dc:creator>
		<pubDate>Sat, 29 Sep 2007 09:36:41 +0000</pubDate>
		<guid isPermaLink="false">http://blog.codefront.net/2007/07/11/better-json-output-from-rails-with-the-jsonifier-plugin/#comment-291098</guid>
		<description>I also get the &quot;wrong number of arguments (1 of 0)&quot; error when I try to use any arguments. I&#039;m stuck, any help would be much appreciated.</description>
		<content:encoded><![CDATA[<p>I also get the &#8220;wrong number of arguments (1 of 0)&#8221; error when I try to use any arguments. I&#8217;m stuck, any help would be much appreciated.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chu Yeow</title>
		<link>http://blog.codefront.net/2007/07/11/better-json-output-from-rails-with-the-jsonifier-plugin/comment-page-1/#comment-285924</link>
		<dc:creator>Chu Yeow</dc:creator>
		<pubDate>Mon, 24 Sep 2007 02:42:51 +0000</pubDate>
		<guid isPermaLink="false">http://blog.codefront.net/2007/07/11/better-json-output-from-rails-with-the-jsonifier-plugin/#comment-285924</guid>
		<description>Well, it doesn&#039;t print out &quot;attributes&quot; anymore, and it supports the &lt;code&gt;:methods&lt;/code&gt; option. I&#039;m sure someone will patch it to support &lt;code&gt;:include&lt;/code&gt; for adding fields from associations as well!</description>
		<content:encoded><![CDATA[<p>Well, it doesn&#8217;t print out &#8220;attributes&#8221; anymore, and it supports the <code>:methods</code> option. I&#8217;m sure someone will patch it to support <code>:include</code> for adding fields from associations as well!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alex Egg</title>
		<link>http://blog.codefront.net/2007/07/11/better-json-output-from-rails-with-the-jsonifier-plugin/comment-page-1/#comment-285634</link>
		<dc:creator>Alex Egg</dc:creator>
		<pubDate>Sun, 23 Sep 2007 19:30:49 +0000</pubDate>
		<guid isPermaLink="false">http://blog.codefront.net/2007/07/11/better-json-output-from-rails-with-the-jsonifier-plugin/#comment-285634</guid>
		<description>@chu

How&#039;s this any different than the current JSON support in rails?</description>
		<content:encoded><![CDATA[<p>@chu</p>
<p>How&#8217;s this any different than the current JSON support in rails?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chu Yeow</title>
		<link>http://blog.codefront.net/2007/07/11/better-json-output-from-rails-with-the-jsonifier-plugin/comment-page-1/#comment-283324</link>
		<dc:creator>Chu Yeow</dc:creator>
		<pubDate>Fri, 21 Sep 2007 10:05:15 +0000</pubDate>
		<guid isPermaLink="false">http://blog.codefront.net/2007/07/11/better-json-output-from-rails-with-the-jsonifier-plugin/#comment-283324</guid>
		<description>You guys may be interested in a recent &lt;a href=&quot;http://dev.rubyonrails.org/changeset/7519&quot; rel=&quot;nofollow&quot;&gt;commit to Rails trunk that adds &lt;code&gt;ActiveRecord::Base#to_json&lt;/code&gt;&lt;/a&gt;. Awesome news, even if it does mean that this plugin is now obsolete (unless you want to use the :include option, which the built-in &lt;code&gt;AR#to_json&lt;/code&gt; doesn&#039;t support).</description>
		<content:encoded><![CDATA[<p>You guys may be interested in a recent <a href="http://dev.rubyonrails.org/changeset/7519" rel="nofollow">commit to Rails trunk that adds <code>ActiveRecord::Base#to_json</code></a>. Awesome news, even if it does mean that this plugin is now obsolete (unless you want to use the :include option, which the built-in <code>AR#to_json</code> doesn&#8217;t support).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alex Egg</title>
		<link>http://blog.codefront.net/2007/07/11/better-json-output-from-rails-with-the-jsonifier-plugin/comment-page-1/#comment-282059</link>
		<dc:creator>Alex Egg</dc:creator>
		<pubDate>Thu, 20 Sep 2007 03:01:46 +0000</pubDate>
		<guid isPermaLink="false">http://blog.codefront.net/2007/07/11/better-json-output-from-rails-with-the-jsonifier-plugin/#comment-282059</guid>
		<description>&quot;Rails 1.2.3 and earlier do not encode Date, Time and DateTime? fields into JSON properly (they become an empty hash when to_json is called on them). Naxnam has reported a similar error with DateTimes over here: http://trac.codefront.net/jsonifier/ticket/3 If you can provide me enough information to replicate it that’d be great!&quot;

So it&#039;s simply not possible to get any db datetimes into json?</description>
		<content:encoded><![CDATA[<p>&#8220;Rails 1.2.3 and earlier do not encode Date, Time and DateTime? fields into JSON properly (they become an empty hash when to_json is called on them). Naxnam has reported a similar error with DateTimes over here: <a href="http://trac.codefront.net/jsonifier/ticket/3" rel="nofollow">http://trac.codefront.net/jsonifier/ticket/3</a> If you can provide me enough information to replicate it that’d be great!&#8221;</p>
<p>So it&#8217;s simply not possible to get any db datetimes into json?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Maximiliano</title>
		<link>http://blog.codefront.net/2007/07/11/better-json-output-from-rails-with-the-jsonifier-plugin/comment-page-1/#comment-265441</link>
		<dc:creator>Maximiliano</dc:creator>
		<pubDate>Thu, 30 Aug 2007 17:30:21 +0000</pubDate>
		<guid isPermaLink="false">http://blog.codefront.net/2007/07/11/better-json-output-from-rails-with-the-jsonifier-plugin/#comment-265441</guid>
		<description>I changed this plugin to has to_json method accessible in Arrays too.

I just do like this:

class Array
  def to_json(options = {})
    self.each {&#124;o&#124; o.to_json(options) }
  end
end

// and in my model:
MyModel.find(:all).to_json()

tonight I&#039;ll send for you a svn patch.</description>
		<content:encoded><![CDATA[<p>I changed this plugin to has to_json method accessible in Arrays too.</p>
<p>I just do like this:</p>
<p>class Array<br />
  def to_json(options = {})<br />
    self.each {|o| o.to_json(options) }<br />
  end<br />
end</p>
<p>// and in my model:<br />
MyModel.find(:all).to_json()</p>
<p>tonight I&#8217;ll send for you a svn patch.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ?????Ruby Library?Rails Plugin</title>
		<link>http://blog.codefront.net/2007/07/11/better-json-output-from-rails-with-the-jsonifier-plugin/comment-page-1/#comment-264149</link>
		<dc:creator>?????Ruby Library?Rails Plugin</dc:creator>
		<pubDate>Wed, 29 Aug 2007 08:13:04 +0000</pubDate>
		<guid isPermaLink="false">http://blog.codefront.net/2007/07/11/better-json-output-from-rails-with-the-jsonifier-plugin/#comment-264149</guid>
		<description>[...] Jsonifier????to_json?????????????????jsonifier??????encoder.rb???Time????to_json???http://blog.codefront.net/2007/07/11/better-json-output-from-rails-with-the-jsonifier-plugin/ [...]</description>
		<content:encoded><![CDATA[<p>[...] Jsonifier????to_json?????????????????jsonifier??????encoder.rb???Time????to_json???http://blog.codefront.net/2007/07/11/better-json-output-from-rails-with-the-jsonifier-plugin/ [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Vinh Tran</title>
		<link>http://blog.codefront.net/2007/07/11/better-json-output-from-rails-with-the-jsonifier-plugin/comment-page-1/#comment-261404</link>
		<dc:creator>Vinh Tran</dc:creator>
		<pubDate>Sun, 26 Aug 2007 02:45:19 +0000</pubDate>
		<guid isPermaLink="false">http://blog.codefront.net/2007/07/11/better-json-output-from-rails-with-the-jsonifier-plugin/#comment-261404</guid>
		<description>Can I also suggest that when we do something like

customer.to_json(:include=&gt;[resources....

if the resources is empty we should get a empty array instead of nothing

Thanks</description>
		<content:encoded><![CDATA[<p>Can I also suggest that when we do something like</p>
<p>customer.to_json(:include=&gt;[resources&#8230;.</p>
<p>if the resources is empty we should get a empty array instead of nothing</p>
<p>Thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chu Yeow</title>
		<link>http://blog.codefront.net/2007/07/11/better-json-output-from-rails-with-the-jsonifier-plugin/comment-page-1/#comment-260077</link>
		<dc:creator>Chu Yeow</dc:creator>
		<pubDate>Fri, 24 Aug 2007 07:39:25 +0000</pubDate>
		<guid isPermaLink="false">http://blog.codefront.net/2007/07/11/better-json-output-from-rails-with-the-jsonifier-plugin/#comment-260077</guid>
		<description>You can output the &lt;code&gt;status&lt;/code&gt; attribute if you provide a reader method to it like so:
&lt;pre&gt;&lt;code class=&quot;ruby&quot;&gt;class ContentCampaign &lt;&lt; ActiveRecord::Base
  attr_reader :status
end&lt;/code&gt;&lt;/pre&gt;

And then pass an additional &lt;code&gt;:methods&lt;/code&gt; option to &lt;code&gt;to_json&lt;/code&gt;:

&lt;pre&gt;&lt;code class=&quot;ruby&quot;&gt;my_campaign.to_json(:methods =&gt; :status)&lt;/code&gt;&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>You can output the <code>status</code> attribute if you provide a reader method to it like so:</p>
<pre><code class="ruby">class ContentCampaign < < ActiveRecord::Base
  attr_reader :status
end</code></code></pre>
<p>And then pass an additional <code>:methods</code> option to <code>to_json</code>:</p>
<pre><code class="ruby">my_campaign.to_json(:methods => :status)</code></pre>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alex Egg</title>
		<link>http://blog.codefront.net/2007/07/11/better-json-output-from-rails-with-the-jsonifier-plugin/comment-page-1/#comment-260074</link>
		<dc:creator>Alex Egg</dc:creator>
		<pubDate>Fri, 24 Aug 2007 07:28:54 +0000</pubDate>
		<guid isPermaLink="false">http://blog.codefront.net/2007/07/11/better-json-output-from-rails-with-the-jsonifier-plugin/#comment-260074</guid>
		<description>haha, here&#039;s one more try with html escaped:

#&lt;ContentCampaign:0x363b8a4 @status=\&quot;Ready\&quot;, @attributes={\&quot;name\&quot;=&gt;\&quot;test\&quot;, \&quot;thumbnail\&quot;=&gt;nil, \&quot;body\&quot;=&gt;\&quot;\&quot;, \&quot;upload_time\&quot;=&gt;nil, \&quot;notes\&quot;=&gt;nil, \&quot;subject\&quot;=&gt;\&quot;\&quot;, \&quot;id\&quot;=&gt;\&quot;15\&quot;, \&quot;billing_code\&quot;=&gt;nil, \&quot;source_video_clip\&quot;=&gt;nil, \&quot;category_id\&quot;=&gt;\&quot;8\&quot;, \&quot;valid_after\&quot;=&gt;nil, \&quot;ad_id_source\&quot;=&gt;nil, \&quot;birth\&quot;=&gt;\&quot;2007-08-23 23:40:37\&quot;}&gt;</description>
		<content:encoded><![CDATA[<p>haha, here&#8217;s one more try with html escaped:</p>
<p>#&lt;ContentCampaign:0&#215;363b8a4 @status=\&quot;Ready\&quot;, @attributes={\&quot;name\&quot;=&gt;\&quot;test\&quot;, \&quot;thumbnail\&quot;=&gt;nil, \&quot;body\&quot;=&gt;\&quot;\&quot;, \&quot;upload_time\&quot;=&gt;nil, \&quot;notes\&quot;=&gt;nil, \&quot;subject\&quot;=&gt;\&quot;\&quot;, \&quot;id\&quot;=&gt;\&quot;15\&quot;, \&quot;billing_code\&quot;=&gt;nil, \&quot;source_video_clip\&quot;=&gt;nil, \&quot;category_id\&quot;=&gt;\&quot;8\&quot;, \&quot;valid_after\&quot;=&gt;nil, \&quot;ad_id_source\&quot;=&gt;nil, \&quot;birth\&quot;=&gt;\&quot;2007-08-23 23:40:37\&quot;}&gt;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alex Egg</title>
		<link>http://blog.codefront.net/2007/07/11/better-json-output-from-rails-with-the-jsonifier-plugin/comment-page-1/#comment-260073</link>
		<dc:creator>Alex Egg</dc:creator>
		<pubDate>Fri, 24 Aug 2007 07:24:54 +0000</pubDate>
		<guid isPermaLink="false">http://blog.codefront.net/2007/07/11/better-json-output-from-rails-with-the-jsonifier-plugin/#comment-260073</guid>
		<description>seems like my brackets were stripped from my previous post, try this:

#&quot;test&quot;, &quot;thumbnail&quot;=&gt;nil, &quot;body&quot;=&gt;&quot;&quot;, &quot;upload_time&quot;=&gt;nil, &quot;notes&quot;=&gt;nil, &quot;subject&quot;=&gt;&quot;&quot;, &quot;id&quot;=&gt;&quot;15&quot;, &quot;billing_code&quot;=&gt;nil, &quot;source_video_clip&quot;=&gt;nil, &quot;category_id&quot;=&gt;&quot;8&quot;, &quot;valid_after&quot;=&gt;nil, &quot;ad_id_source&quot;=&gt;nil, &quot;birth&quot;=&gt;&quot;2007-08-23 23:40:37&quot;}&gt;</description>
		<content:encoded><![CDATA[<p>seems like my brackets were stripped from my previous post, try this:</p>
<p>#&#8221;test&#8221;, &#8220;thumbnail&#8221;=&gt;nil, &#8220;body&#8221;=&gt;&#8221;", &#8220;upload_time&#8221;=&gt;nil, &#8220;notes&#8221;=&gt;nil, &#8220;subject&#8221;=&gt;&#8221;", &#8220;id&#8221;=&gt;&#8221;15&#8243;, &#8220;billing_code&#8221;=&gt;nil, &#8220;source_video_clip&#8221;=&gt;nil, &#8220;category_id&#8221;=&gt;&#8221;8&#8243;, &#8220;valid_after&#8221;=&gt;nil, &#8220;ad_id_source&#8221;=&gt;nil, &#8220;birth&#8221;=&gt;&#8221;2007-08-23 23:40:37&#8243;}&gt;</p>
]]></content:encoded>
	</item>
</channel>
</rss>
