<?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"
	>
<channel>
	<title>Comments on: Pretty blocks in Rails views</title>
	<atom:link href="http://www.pathf.com/blogs/2008/07/pretty-blocks-in-rails-views/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.pathf.com/blogs/2008/07/pretty-blocks-in-rails-views/</link>
	<description>Running commentary about agile development, user experience design and Ajax.</description>
	<pubDate>Fri, 05 Dec 2008 08:16:33 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5.1</generator>
		<item>
		<title>By: Pathfinder Development &#187; Rails 2.2 For Me And For You</title>
		<link>http://www.pathf.com/blogs/2008/07/pretty-blocks-in-rails-views/#comment-3973</link>
		<dc:creator>Pathfinder Development &#187; Rails 2.2 For Me And For You</dc:creator>
		<pubDate>Fri, 31 Oct 2008 19:25:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.pathf.com/blogs/?p=998#comment-3973</guid>
		<description>[...] This may be the most subtle change I've ever been this excited about. Let's go back to the bad old days -- last week -- and say that you wanted to write a block helper method like this: [...]</description>
		<content:encoded><![CDATA[<p>[...] This may be the most subtle change I&#8217;ve ever been this excited about. Let&#8217;s go back to the bad old days &#8212; last week &#8212; and say that you wanted to write a block helper method like this: [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: cs</title>
		<link>http://www.pathf.com/blogs/2008/07/pretty-blocks-in-rails-views/#comment-3708</link>
		<dc:creator>cs</dc:creator>
		<pubDate>Fri, 17 Oct 2008 12:06:55 +0000</pubDate>
		<guid isPermaLink="false">http://www.pathf.com/blogs/?p=998#comment-3708</guid>
		<description>sorry, the view code was sanitized ...

in view:
ajax_call(params) do 
 a_method_to_be_called(with_params)
end</description>
		<content:encoded><![CDATA[<p>sorry, the view code was sanitized &#8230;</p>
<p>in view:<br />
ajax_call(params) do<br />
 a_method_to_be_called(with_params)<br />
end</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: cs</title>
		<link>http://www.pathf.com/blogs/2008/07/pretty-blocks-in-rails-views/#comment-3707</link>
		<dc:creator>cs</dc:creator>
		<pubDate>Fri, 17 Oct 2008 12:04:58 +0000</pubDate>
		<guid isPermaLink="false">http://www.pathf.com/blogs/?p=998#comment-3707</guid>
		<description>Very interesting!

These techniques opens up many possibilities, some even very strange:

in view:

 a_method_to_be_called(with_params)


the ajax_call in the helper:
concat(
 link_to_remote("Add", :url=&#62; {:controller =&#62; ..., :action =&#62; ..., :block =&#62; capture(&#38;block)}
), block.binding)

This means we can pass to controllers functions to be executed, functions defined freely in views.

Does this sound weird for you?</description>
		<content:encoded><![CDATA[<p>Very interesting!</p>
<p>These techniques opens up many possibilities, some even very strange:</p>
<p>in view:</p>
<p> a_method_to_be_called(with_params)</p>
<p>the ajax_call in the helper:<br />
concat(<br />
 link_to_remote(&#8221;Add&#8221;, :url=&gt; {:controller =&gt; &#8230;, :action =&gt; &#8230;, :block =&gt; capture(&amp;block)}<br />
), block.binding)</p>
<p>This means we can pass to controllers functions to be executed, functions defined freely in views.</p>
<p>Does this sound weird for you?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Daniel Lopes</title>
		<link>http://www.pathf.com/blogs/2008/07/pretty-blocks-in-rails-views/#comment-2711</link>
		<dc:creator>Daniel Lopes</dc:creator>
		<pubDate>Thu, 31 Jul 2008 17:44:10 +0000</pubDate>
		<guid isPermaLink="false">http://www.pathf.com/blogs/?p=998#comment-2711</guid>
		<description>Thanks for the advice, really helpfull. I prefer use the rails default (prototype and scriptaculous )and how good will be if prototype add corner method to your features.</description>
		<content:encoded><![CDATA[<p>Thanks for the advice, really helpfull. I prefer use the rails default (prototype and scriptaculous )and how good will be if prototype add corner method to your features.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Keith Carter</title>
		<link>http://www.pathf.com/blogs/2008/07/pretty-blocks-in-rails-views/#comment-2439</link>
		<dc:creator>Keith Carter</dc:creator>
		<pubDate>Wed, 16 Jul 2008 01:47:39 +0000</pubDate>
		<guid isPermaLink="false">http://www.pathf.com/blogs/?p=998#comment-2439</guid>
		<description>There are a couple of errors in the code samples in the "Here's an example of the rounded_corner code I actually use in my applications" part of this post.

First, the "rounded_yellow_box" call needs a "do" at the end of it.

And "if options[:background]" needs to be followed by a "then".</description>
		<content:encoded><![CDATA[<p>There are a couple of errors in the code samples in the &#8220;Here&#8217;s an example of the rounded_corner code I actually use in my applications&#8221; part of this post.</p>
<p>First, the &#8220;rounded_yellow_box&#8221; call needs a &#8220;do&#8221; at the end of it.</p>
<p>And &#8220;if options[:background]&#8221; needs to be followed by a &#8220;then&#8221;.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Lawrence Pit</title>
		<link>http://www.pathf.com/blogs/2008/07/pretty-blocks-in-rails-views/#comment-2397</link>
		<dc:creator>Lawrence Pit</dc:creator>
		<pubDate>Mon, 14 Jul 2008 01:10:15 +0000</pubDate>
		<guid isPermaLink="false">http://www.pathf.com/blogs/?p=998#comment-2397</guid>
		<description>Choosing a different template engine might improve readability and reusability even further. I use haml and jquery, and all I do is:

  .corner Rounded corners are so Web 2.0.

and in application.js:

  $('.corner').corner();

and in css e.g.:

  .corner { background:#ffe; border:1px solid #999; }

Can't get easier then this.</description>
		<content:encoded><![CDATA[<p>Choosing a different template engine might improve readability and reusability even further. I use haml and jquery, and all I do is:</p>
<p>  .corner Rounded corners are so Web 2.0.</p>
<p>and in application.js:</p>
<p>  $(&#8217;.corner&#8217;).corner();</p>
<p>and in css e.g.:</p>
<p>  .corner { background:#ffe; border:1px solid #999; }</p>
<p>Can&#8217;t get easier then this.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: J. Ryan Sobol</title>
		<link>http://www.pathf.com/blogs/2008/07/pretty-blocks-in-rails-views/#comment-2386</link>
		<dc:creator>J. Ryan Sobol</dc:creator>
		<pubDate>Sun, 13 Jul 2008 01:02:08 +0000</pubDate>
		<guid isPermaLink="false">http://www.pathf.com/blogs/?p=998#comment-2386</guid>
		<description>Well-written article and your code really pushes deep into rails helpers.  Well done!

Unfortunately, readers should be cautious of injecting HTML syntax directly into helper methods in ruby.  Typically, the larger the project, the faster the HTML changes.  And if your designers aren't familiar with ruby, then change becomes hard.</description>
		<content:encoded><![CDATA[<p>Well-written article and your code really pushes deep into rails helpers.  Well done!</p>
<p>Unfortunately, readers should be cautious of injecting HTML syntax directly into helper methods in ruby.  Typically, the larger the project, the faster the HTML changes.  And if your designers aren&#8217;t familiar with ruby, then change becomes hard.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: chris</title>
		<link>http://www.pathf.com/blogs/2008/07/pretty-blocks-in-rails-views/#comment-2368</link>
		<dc:creator>chris</dc:creator>
		<pubDate>Sat, 12 Jul 2008 04:09:45 +0000</pubDate>
		<guid isPermaLink="false">http://www.pathf.com/blogs/?p=998#comment-2368</guid>
		<description>Good points.  Much of this was discussed before, but reminders are always good.

http://www.igvita.com/2007/03/15/block-helpers-and-dry-views-in-rails/</description>
		<content:encoded><![CDATA[<p>Good points.  Much of this was discussed before, but reminders are always good.</p>
<p><a href="http://www.igvita.com/2007/03/15/block-helpers-and-dry-views-in-rails/" rel="nofollow">http://www.igvita.com/2007/03/15/block-helpers-and-dry-views-in-rails/</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Aditya Sanghi</title>
		<link>http://www.pathf.com/blogs/2008/07/pretty-blocks-in-rails-views/#comment-2341</link>
		<dc:creator>Aditya Sanghi</dc:creator>
		<pubDate>Thu, 10 Jul 2008 08:25:49 +0000</pubDate>
		<guid isPermaLink="false">http://www.pathf.com/blogs/?p=998#comment-2341</guid>
		<description>Absolutely awesome post. I'm getting my whole team to refactor today using some of the concepts you've mentioned above. And we can really use the RoundedCorners example above!! 

Cheers mate!
Aditya</description>
		<content:encoded><![CDATA[<p>Absolutely awesome post. I&#8217;m getting my whole team to refactor today using some of the concepts you&#8217;ve mentioned above. And we can really use the RoundedCorners example above!! </p>
<p>Cheers mate!<br />
Aditya</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kris</title>
		<link>http://www.pathf.com/blogs/2008/07/pretty-blocks-in-rails-views/#comment-2283</link>
		<dc:creator>Kris</dc:creator>
		<pubDate>Fri, 04 Jul 2008 11:49:12 +0000</pubDate>
		<guid isPermaLink="false">http://www.pathf.com/blogs/?p=998#comment-2283</guid>
		<description>Hi, How would you make a make a method yield a block which contains  tags?

eg.
In Helper:
def not_for_customer
  yield
end

In View:

 


'our_ref' is not rendered...</description>
		<content:encoded><![CDATA[<p>Hi, How would you make a make a method yield a block which contains  tags?</p>
<p>eg.<br />
In Helper:<br />
def not_for_customer<br />
  yield<br />
end</p>
<p>In View:</p>
<p>&#8216;our_ref&#8217; is not rendered&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ric</title>
		<link>http://www.pathf.com/blogs/2008/07/pretty-blocks-in-rails-views/#comment-2274</link>
		<dc:creator>Ric</dc:creator>
		<pubDate>Thu, 03 Jul 2008 16:00:53 +0000</pubDate>
		<guid isPermaLink="false">http://www.pathf.com/blogs/?p=998#comment-2274</guid>
		<description>Hi Josh - great article.  Some useful tips in there.</description>
		<content:encoded><![CDATA[<p>Hi Josh - great article.  Some useful tips in there.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: A Fresh Cup &#187; Blog Archive &#187; Double Shot #240</title>
		<link>http://www.pathf.com/blogs/2008/07/pretty-blocks-in-rails-views/#comment-2273</link>
		<dc:creator>A Fresh Cup &#187; Blog Archive &#187; Double Shot #240</dc:creator>
		<pubDate>Thu, 03 Jul 2008 11:06:01 +0000</pubDate>
		<guid isPermaLink="false">http://www.pathf.com/blogs/?p=998#comment-2273</guid>
		<description>[...] Pretty Blocks in Rails Views - Some ways to make your code more elegant. [...]</description>
		<content:encoded><![CDATA[<p>[...] Pretty Blocks in Rails Views - Some ways to make your code more elegant. [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Benny</title>
		<link>http://www.pathf.com/blogs/2008/07/pretty-blocks-in-rails-views/#comment-2262</link>
		<dc:creator>Benny</dc:creator>
		<pubDate>Wed, 02 Jul 2008 17:38:36 +0000</pubDate>
		<guid isPermaLink="false">http://www.pathf.com/blogs/?p=998#comment-2262</guid>
		<description>Nice post. But you really should try out HAML and the ultimate cool concat helpers. Your helper methods will look much nicer and the output too. :)</description>
		<content:encoded><![CDATA[<p>Nice post. But you really should try out HAML and the ultimate cool concat helpers. Your helper methods will look much nicer and the output too. <img src='http://www.pathf.com/blogs/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Roy van der Meij</title>
		<link>http://www.pathf.com/blogs/2008/07/pretty-blocks-in-rails-views/#comment-2258</link>
		<dc:creator>Roy van der Meij</dc:creator>
		<pubDate>Wed, 02 Jul 2008 13:11:25 +0000</pubDate>
		<guid isPermaLink="false">http://www.pathf.com/blogs/?p=998#comment-2258</guid>
		<description>Really nice article Josh, I didn't know you could yield in partials.
This is gonna clean up my code a lot.</description>
		<content:encoded><![CDATA[<p>Really nice article Josh, I didn&#8217;t know you could yield in partials.<br />
This is gonna clean up my code a lot.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alistair Holt</title>
		<link>http://www.pathf.com/blogs/2008/07/pretty-blocks-in-rails-views/#comment-2257</link>
		<dc:creator>Alistair Holt</dc:creator>
		<pubDate>Wed, 02 Jul 2008 11:37:12 +0000</pubDate>
		<guid isPermaLink="false">http://www.pathf.com/blogs/?p=998#comment-2257</guid>
		<description>Good post. I've been using these techniques for a while and it does make views code so much more readable and nicer to look at. :)</description>
		<content:encoded><![CDATA[<p>Good post. I&#8217;ve been using these techniques for a while and it does make views code so much more readable and nicer to look at. <img src='http://www.pathf.com/blogs/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ethan vizitei</title>
		<link>http://www.pathf.com/blogs/2008/07/pretty-blocks-in-rails-views/#comment-2256</link>
		<dc:creator>ethan vizitei</dc:creator>
		<pubDate>Wed, 02 Jul 2008 01:01:31 +0000</pubDate>
		<guid isPermaLink="false">http://www.pathf.com/blogs/?p=998#comment-2256</guid>
		<description>Well done, Josh.  I think your evaluation of the common state of view code is spot on (I know it's true for MY code) and the suggestions you put forth are good examples of how developers should be thinking when putting together the UI of their application.</description>
		<content:encoded><![CDATA[<p>Well done, Josh.  I think your evaluation of the common state of view code is spot on (I know it&#8217;s true for MY code) and the suggestions you put forth are good examples of how developers should be thinking when putting together the UI of their application.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mike Breen</title>
		<link>http://www.pathf.com/blogs/2008/07/pretty-blocks-in-rails-views/#comment-2253</link>
		<dc:creator>Mike Breen</dc:creator>
		<pubDate>Tue, 01 Jul 2008 21:02:18 +0000</pubDate>
		<guid isPermaLink="false">http://www.pathf.com/blogs/?p=998#comment-2253</guid>
		<description>Nice article Josh. I love posts that change the way I think about doing things in rails.</description>
		<content:encoded><![CDATA[<p>Nice article Josh. I love posts that change the way I think about doing things in rails.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
