<?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 for Pieces of Web</title>
	<atom:link href="http://danengle.us/comments/feed/" rel="self" type="application/rss+xml" />
	<link>http://danengle.us</link>
	<description>Dan Engle's Rails and Web Development Blog</description>
	<lastBuildDate>Wed, 25 Aug 2010 21:08:37 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
	<item>
		<title>Comment on Generating custom XML for your rails app by Luki</title>
		<link>http://danengle.us/2009/05/generating-custom-xml-for-your-rails-app/comment-page-1/#comment-421</link>
		<dc:creator>Luki</dc:creator>
		<pubDate>Wed, 25 Aug 2010 21:08:37 +0000</pubDate>
		<guid isPermaLink="false">http://danengle.us/?p=83#comment-421</guid>
		<description>Hey great job! its unbelievable easy to generate custom XML whit your solution! unfortunately there are hardly any tutorials about it. Thx a lot</description>
		<content:encoded><![CDATA[<p>Hey great job! its unbelievable easy to generate custom XML whit your solution! unfortunately there are hardly any tutorials about it. Thx a lot</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Adding Some Additional Security Measures to restful_authentication by garage roller doors</title>
		<link>http://danengle.us/2009/03/adding-some-additional-security-measures-to-restful_authentication/comment-page-1/#comment-420</link>
		<dc:creator>garage roller doors</dc:creator>
		<pubDate>Fri, 25 Jun 2010 12:56:52 +0000</pubDate>
		<guid isPermaLink="false">http://danengle.us/?p=68#comment-420</guid>
		<description>thanks for this it was an interesting read.</description>
		<content:encoded><![CDATA[<p>thanks for this it was an interesting read.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Extending the will_paginate Rails Plugin by Ben</title>
		<link>http://danengle.us/2009/03/extending-the-will_paginate-rails-plugins/comment-page-1/#comment-418</link>
		<dc:creator>Ben</dc:creator>
		<pubDate>Mon, 10 May 2010 13:40:39 +0000</pubDate>
		<guid isPermaLink="false">http://danengle.us/?p=44#comment-418</guid>
		<description>Your suggestion works very well. Thanks!</description>
		<content:encoded><![CDATA[<p>Your suggestion works very well. Thanks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Generating custom XML for your rails app by Paul Hailes</title>
		<link>http://danengle.us/2009/05/generating-custom-xml-for-your-rails-app/comment-page-1/#comment-408</link>
		<dc:creator>Paul Hailes</dc:creator>
		<pubDate>Sat, 24 Oct 2009 15:40:05 +0000</pubDate>
		<guid isPermaLink="false">http://danengle.us/?p=83#comment-408</guid>
		<description>I can&#039;t believe how easy it just was to re-create a 2 page long php script which generated a xml file with a tiny bit of rails code.. and it&#039;s a lot cleaner and easier to read! Thanks for posting your feedback.
One thing that might help others is you can use standard # comments next to the code to put a example next of the output. (thought that&#039;s probably obvious to someone with more rails experience than me!)</description>
		<content:encoded><![CDATA[<p>I can&#8217;t believe how easy it just was to re-create a 2 page long php script which generated a xml file with a tiny bit of rails code.. and it&#8217;s a lot cleaner and easier to read! Thanks for posting your feedback.<br />
One thing that might help others is you can use standard # comments next to the code to put a example next of the output. (thought that&#8217;s probably obvious to someone with more rails experience than me!)</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Generating custom XML for your rails app by Mike</title>
		<link>http://danengle.us/2009/05/generating-custom-xml-for-your-rails-app/comment-page-1/#comment-407</link>
		<dc:creator>Mike</dc:creator>
		<pubDate>Sun, 11 Oct 2009 03:05:21 +0000</pubDate>
		<guid isPermaLink="false">http://danengle.us/?p=83#comment-407</guid>
		<description>You saved me a lot of time, thank you!</description>
		<content:encoded><![CDATA[<p>You saved me a lot of time, thank you!</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Generating custom XML for your rails app by Jim Carrig</title>
		<link>http://danengle.us/2009/05/generating-custom-xml-for-your-rails-app/comment-page-1/#comment-406</link>
		<dc:creator>Jim Carrig</dc:creator>
		<pubDate>Fri, 02 Oct 2009 17:44:54 +0000</pubDate>
		<guid isPermaLink="false">http://danengle.us/?p=83#comment-406</guid>
		<description>Another way is to override the default ActiveRecord to_xml method in post.rb.  This lets you easily use the same builder code in different contexts -- most importantly for singular and plural outputs.

For example, this takes care of both the posts.xml and posts/20.xml requests where the plural form uses

  format.xml { render :xml =&gt; @posts }
and the singular uses
  format.xml { render :xml =&gt; @post }

  def to_xml(options={})
    if options[:builder]
      build_xml(options[:builder])
    else
      xml = Builder::XmlMarkup.new
      xml.instruct!
      build_xml(xml)
    end
  end
  private
  def build_xml(xml)
      xml.tag!(&quot;created-at&quot;, created_at, :type =&gt; :datetime)
      xml.tag!(&quot;updated-at&quot;, updated_at, :type =&gt; :datetime)
      xml.title post.title
      xml.body post.body
      xml.published_at post.published_at
      xml.comments do
        post.comments.each do &#124;comment&#124;
          xml.comment do
            xml.body comment.body
          end
        end
      end
  end</description>
		<content:encoded><![CDATA[<p>Another way is to override the default ActiveRecord to_xml method in post.rb.  This lets you easily use the same builder code in different contexts &#8212; most importantly for singular and plural outputs.</p>
<p>For example, this takes care of both the posts.xml and posts/20.xml requests where the plural form uses</p>
<p>  format.xml { render <img src='http://danengle.us/wp-includes/images/smilies/icon_mad.gif' alt=':x' class='wp-smiley' /> ml =&gt; @posts }<br />
and the singular uses<br />
  format.xml { render <img src='http://danengle.us/wp-includes/images/smilies/icon_mad.gif' alt=':x' class='wp-smiley' /> ml =&gt; @post }</p>
<p>  def to_xml(options={})<br />
    if options[:builder]<br />
      build_xml(options[:builder])<br />
    else<br />
      xml = Builder::XmlMarkup.new<br />
      xml.instruct!<br />
      build_xml(xml)<br />
    end<br />
  end<br />
  private<br />
  def build_xml(xml)<br />
      xml.tag!(&#8220;created-at&#8221;, created_at, :type =&gt; :datetime)<br />
      xml.tag!(&#8220;updated-at&#8221;, updated_at, :type =&gt; :datetime)<br />
      xml.title post.title<br />
      xml.body post.body<br />
      xml.published_at post.published_at<br />
      xml.comments do<br />
        post.comments.each do |comment|<br />
          xml.comment do<br />
            xml.body comment.body<br />
          end<br />
        end<br />
      end<br />
  end</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Generating custom XML for your rails app by rails models are views? &#124; the evolving ultrasaurus</title>
		<link>http://danengle.us/2009/05/generating-custom-xml-for-your-rails-app/comment-page-1/#comment-405</link>
		<dc:creator>rails models are views? &#124; the evolving ultrasaurus</dc:creator>
		<pubDate>Tue, 01 Sep 2009 03:07:17 +0000</pubDate>
		<guid isPermaLink="false">http://danengle.us/?p=83#comment-405</guid>
		<description>[...] xml, this strange controller pattern is easily corrected by providing an xml view. The xml builder syntax is particularly readable, and it is easy to design your XML API [...]</description>
		<content:encoded><![CDATA[<p>[...] xml, this strange controller pattern is easily corrected by providing an xml view. The xml builder syntax is particularly readable, and it is easy to design your XML API [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Adding Some Additional Security Measures to restful_authentication by Dan</title>
		<link>http://danengle.us/2009/03/adding-some-additional-security-measures-to-restful_authentication/comment-page-1/#comment-403</link>
		<dc:creator>Dan</dc:creator>
		<pubDate>Tue, 04 Aug 2009 21:13:35 +0000</pubDate>
		<guid isPermaLink="false">http://danengle.us/?p=68#comment-403</guid>
		<description>I thought about keeping the full login history, but I ultimately decided against it because keeping track of all of them could cause the database to grow fairly large and then you&#039;d probably need a cron job of sorts to remove records that are x days or so old, so this was just a simpler solution.

by_attempt_window is a named_scope of the LoginAttempt model, so you&#039;ll want to place it in there.

Thanks for the comment!</description>
		<content:encoded><![CDATA[<p>I thought about keeping the full login history, but I ultimately decided against it because keeping track of all of them could cause the database to grow fairly large and then you&#8217;d probably need a cron job of sorts to remove records that are x days or so old, so this was just a simpler solution.</p>
<p>by_attempt_window is a named_scope of the LoginAttempt model, so you&#8217;ll want to place it in there.</p>
<p>Thanks for the comment!</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Adding Some Additional Security Measures to restful_authentication by Phil Rosenstein</title>
		<link>http://danengle.us/2009/03/adding-some-additional-security-measures-to-restful_authentication/comment-page-1/#comment-402</link>
		<dc:creator>Phil Rosenstein</dc:creator>
		<pubDate>Thu, 30 Jul 2009 03:40:43 +0000</pubDate>
		<guid isPermaLink="false">http://danengle.us/?p=68#comment-402</guid>
		<description>I&#039;m making similar additions to restful_authentication (without aasm) but I&#039;m planning to have LoginAttempt keep a full login history instead of just the most recent failed attempts.  

I&#039;m somewhat of a rails noob and so I&#039;m wondering where &quot;by_attempt_window&quot; comes from?  I tried adding the following to my user model:
named_scope :by_attempt_window, lambda { &#124;time_ago&#124; { :conditions =&gt; [&#039;created_at &gt; ?&#039;, time_ago] } }
but I still get undefined method `by_attempt_window&#039;.

This is a good project, I agree that restful_authentication needs this.</description>
		<content:encoded><![CDATA[<p>I&#8217;m making similar additions to restful_authentication (without aasm) but I&#8217;m planning to have LoginAttempt keep a full login history instead of just the most recent failed attempts.  </p>
<p>I&#8217;m somewhat of a rails noob and so I&#8217;m wondering where &#8220;by_attempt_window&#8221; comes from?  I tried adding the following to my user model:<br />
named_scope :by_attempt_window, lambda { |time_ago| { :conditions =&gt; ['created_at &gt; ?', time_ago] } }<br />
but I still get undefined method `by_attempt_window&#8217;.</p>
<p>This is a good project, I agree that restful_authentication needs this.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Generating custom XML for your rails app by Creating custom XML in Ruby on Rails : compiled thoughts</title>
		<link>http://danengle.us/2009/05/generating-custom-xml-for-your-rails-app/comment-page-1/#comment-401</link>
		<dc:creator>Creating custom XML in Ruby on Rails : compiled thoughts</dc:creator>
		<pubDate>Sat, 11 Jul 2009 21:09:01 +0000</pubDate>
		<guid isPermaLink="false">http://danengle.us/?p=83#comment-401</guid>
		<description>[...] a custom XML file for your model. I had a little trouble finding out how to do this on the web; this site and this one helped a little but could have been more specific. I&#8217;m going to go through this [...]</description>
		<content:encoded><![CDATA[<p>[...] a custom XML file for your model. I had a little trouble finding out how to do this on the web; this site and this one helped a little but could have been more specific. I&#8217;m going to go through this [...]</p>
]]></content:encoded>
	</item>
</channel>
</rss>

