<?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: Helper to Display Rails Flash Messages</title>
	<atom:link href="http://ianpurton.com/helper-to-display-rails-flash-messages/feed/" rel="self" type="application/rss+xml" />
	<link>http://ianpurton.com/helper-to-display-rails-flash-messages/</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Thu, 18 Feb 2010 09:15:11 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: nuks</title>
		<link>http://ianpurton.com/helper-to-display-rails-flash-messages/comment-page-1/#comment-123</link>
		<dc:creator>nuks</dc:creator>
		<pubDate>Wed, 23 Sep 2009 08:18:29 +0000</pubDate>
		<guid isPermaLink="false">http://ianpurton.com/helper-to-display-rails-flash-messages/#comment-123</guid>
		<description>Perhaps you guys may want to look at this -&gt; http://nuks88.wordpress.com/2009/09/17/ymlized-and-styled-flash-messages-ysfm-in-rails/</description>
		<content:encoded><![CDATA[<p>Perhaps you guys may want to look at this -> <a href="http://nuks88.wordpress.com/2009/09/17/ymlized-and-styled-flash-messages-ysfm-in-rails/" rel="nofollow">http://nuks88.wordpress.com/2009/09/17/ymlized-and-styled-flash-messages-ysfm-in-rails/</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Coding Dojo #13: TDD as if you meant it at Mark Needham</title>
		<link>http://ianpurton.com/helper-to-display-rails-flash-messages/comment-page-1/#comment-124</link>
		<dc:creator>Coding Dojo #13: TDD as if you meant it at Mark Needham</dc:creator>
		<pubDate>Wed, 29 Apr 2009 20:15:12 +0000</pubDate>
		<guid isPermaLink="false">http://ianpurton.com/helper-to-display-rails-flash-messages/#comment-124</guid>
		<description>[...] We worked on implementing a Flash Message interceptor, to hook into the Spring framework, that one of my colleague&#039;s has been working on - the idea is to show a flash method to the user, that message being stored in the session on a Post and then removed on a Get in the &#039;Post-Redirect-Get&#039; cycle. It&#039;s similar to the &#039;:flash&#039; messages that get passed around in Rails. [...]</description>
		<content:encoded><![CDATA[<p>[...] We worked on implementing a Flash Message interceptor, to hook into the Spring framework, that one of my colleague&#8217;s has been working on &#8211; the idea is to show a flash method to the user, that message being stored in the session on a Post and then removed on a Get in the &#8216;Post-Redirect-Get&#8217; cycle. It&#8217;s similar to the &#8216;:flash&#8217; messages that get passed around in Rails. [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: spannarissuro</title>
		<link>http://ianpurton.com/helper-to-display-rails-flash-messages/comment-page-1/#comment-127</link>
		<dc:creator>spannarissuro</dc:creator>
		<pubDate>Tue, 28 Oct 2008 22:05:53 +0000</pubDate>
		<guid isPermaLink="false">http://ianpurton.com/helper-to-display-rails-flash-messages/#comment-127</guid>
		<description>OK, let me repeat that… Do you have a sense of wonder about my   comfortable  doubt  A JOKE! )   What is three feet long? A yard.</description>
		<content:encoded><![CDATA[<p>OK, let me repeat that… Do you have a sense of wonder about my   comfortable  doubt  A JOKE! )   What is three feet long? A yard.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jarrod</title>
		<link>http://ianpurton.com/helper-to-display-rails-flash-messages/comment-page-1/#comment-122</link>
		<dc:creator>Jarrod</dc:creator>
		<pubDate>Thu, 13 Mar 2008 14:09:25 +0000</pubDate>
		<guid isPermaLink="false">http://ianpurton.com/helper-to-display-rails-flash-messages/#comment-122</guid>
		<description>@Dallas

I disagree... I think having a little markup in your helpers is perfectly acceptable. They are &quot;help&quot; for your presentation after all. I think the main mistake people make is using helpers for things that should go into a partial.</description>
		<content:encoded><![CDATA[<p>@Dallas</p>
<p>I disagree&#8230; I think having a little markup in your helpers is perfectly acceptable. They are &#8220;help&#8221; for your presentation after all. I think the main mistake people make is using helpers for things that should go into a partial.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Adam Salter</title>
		<link>http://ianpurton.com/helper-to-display-rails-flash-messages/comment-page-1/#comment-118</link>
		<dc:creator>Adam Salter</dc:creator>
		<pubDate>Mon, 10 Dec 2007 22:28:26 +0000</pubDate>
		<guid isPermaLink="false">http://ianpurton.com/helper-to-display-rails-flash-messages/#comment-118</guid>
		<description>woops, I mean

def flash_helper
[:notice, :warning, :message].map { &#124;f&#124; content_tag(:div, flash[f], :class =&gt; f) if flash[f] }
end</description>
		<content:encoded><![CDATA[<p>woops, I mean</p>
<p>def flash_helper<br />
[:notice, :warning, :message].map { |f| content_tag(:div, flash[f], :class =&gt; f) if flash[f] }<br />
end</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Adam Salter</title>
		<link>http://ianpurton.com/helper-to-display-rails-flash-messages/comment-page-1/#comment-121</link>
		<dc:creator>Adam Salter</dc:creator>
		<pubDate>Mon, 10 Dec 2007 22:24:44 +0000</pubDate>
		<guid isPermaLink="false">http://ianpurton.com/helper-to-display-rails-flash-messages/#comment-121</guid>
		<description>here&#039;s another version of the above, even more terse...

def flash_helper
  [:notice, :warning, :message].map { &#124;f&#124; content_tag(:div, flash[f], :class =&gt; type) if flash[f] }
end</description>
		<content:encoded><![CDATA[<p>here&#8217;s another version of the above, even more terse&#8230;</p>
<p>def flash_helper<br />
  [:notice, :warning, :message].map { |f| content_tag(:div, flash[f], :class =&gt; type) if flash[f] }<br />
end</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: S. Potter</title>
		<link>http://ianpurton.com/helper-to-display-rails-flash-messages/comment-page-1/#comment-119</link>
		<dc:creator>S. Potter</dc:creator>
		<pubDate>Tue, 03 Jul 2007 02:40:07 +0000</pubDate>
		<guid isPermaLink="false">http://ianpurton.com/helper-to-display-rails-flash-messages/#comment-119</guid>
		<description>Formatting of previous comment (or lackthereof) may cause misunderstanding.  Code should read:

&lt;pre name=&quot;code&quot; class=&quot;ruby&quot;&gt;
def render_flash_messages
  result = &#039;&#039;
  for type in [:notice, :warning, :message]
    message = flash[type]
    result #{message}â€
  end
  result
end
&lt;/pre&gt;

I should also note that content_tag is quite slow, which is why I used the inline string to generate HTML.  If a partial was used instead (for the MVC purist, which I am usually) that would have incurred an even higher performance hit, which in most of my applications isn&#039;t worth the extra purity of the code.</description>
		<content:encoded><![CDATA[<p>Formatting of previous comment (or lackthereof) may cause misunderstanding.  Code should read:</p>
<pre name="code" class="ruby">
def render_flash_messages
  result = ''
  for type in [:notice, :warning, :message]
    message = flash[type]
    result #{message}â€
  end
  result
end
</pre>
<p>I should also note that content_tag is quite slow, which is why I used the inline string to generate HTML.  If a partial was used instead (for the MVC purist, which I am usually) that would have incurred an even higher performance hit, which in most of my applications isn&#8217;t worth the extra purity of the code.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: S. Potter</title>
		<link>http://ianpurton.com/helper-to-display-rails-flash-messages/comment-page-1/#comment-120</link>
		<dc:creator>S. Potter</dc:creator>
		<pubDate>Tue, 03 Jul 2007 02:36:10 +0000</pubDate>
		<guid isPermaLink="false">http://ianpurton.com/helper-to-display-rails-flash-messages/#comment-120</guid>
		<description>I use a more terse version of what your code does:

&lt;pre name=&quot;code&quot; class=&quot;ruby&quot;&gt;
  def render_flash_messages
    result = &#039;&#039;
    for type in [:notice, :warning, :message]
      message = flash[type]
      # commented out content_tag, while cleaner is very inefficient
      #content_tag(&#039;div&#039;, message, :class =&gt; type) if message
      # using string inline method...
      result #{message}&quot;
    end
    result
  end
&lt;/pre&gt;

A few things should be noted:
flash_helper and render_flash_messages are roughly equivalent performance wiseflash_helper has a defect in it.  Line 8 should read: &lt;code&gt;fl = fl + â€#{flash[name]}â€&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>I use a more terse version of what your code does:</p>
<pre name="code" class="ruby">
  def render_flash_messages
    result = ''
    for type in [:notice, :warning, :message]
      message = flash[type]
      # commented out content_tag, while cleaner is very inefficient
      #content_tag('div', message, :class =&gt; type) if message
      # using string inline method...
      result #{message}"
    end
    result
  end
</pre>
<p>A few things should be noted:<br />
flash_helper and render_flash_messages are roughly equivalent performance wiseflash_helper has a defect in it.  Line 8 should read: <code>fl = fl + â€#{flash[name]}â€</code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dallas</title>
		<link>http://ianpurton.com/helper-to-display-rails-flash-messages/comment-page-1/#comment-117</link>
		<dc:creator>Dallas</dc:creator>
		<pubDate>Thu, 31 May 2007 17:05:10 +0000</pubDate>
		<guid isPermaLink="false">http://ianpurton.com/helper-to-display-rails-flash-messages/#comment-117</guid>
		<description>You really should not put xhtml code into your helpers. Keep your content, layout, functional code, and styles separate.</description>
		<content:encoded><![CDATA[<p>You really should not put xhtml code into your helpers. Keep your content, layout, functional code, and styles separate.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mark</title>
		<link>http://ianpurton.com/helper-to-display-rails-flash-messages/comment-page-1/#comment-116</link>
		<dc:creator>Mark</dc:creator>
		<pubDate>Wed, 18 Apr 2007 07:27:11 +0000</pubDate>
		<guid isPermaLink="false">http://ianpurton.com/helper-to-display-rails-flash-messages/#comment-116</guid>
		<description>Thank You</description>
		<content:encoded><![CDATA[<p>Thank You</p>
]]></content:encoded>
	</item>
</channel>
</rss>
