<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DZone Snippets: actionview code</title>
    <link>http://snippets.dzone.com/posts</link>
    <pubDate>Mon, 06 Oct 2008 09:30:11 GMT</pubDate>
    <description>DZone Snippets: actionview code</description>
    <item>
      <title>Custom captures</title>
      <link>http://snippets.dzone.com/posts/show/390</link>
      <description>I made a layout with some slightly ugly code for making rounded boxes with CSS and HTML, and wanted a way to automate the boxes. I had thought of having two functions to print starting and ending code, but this seems nicer.&lt;br /&gt;&lt;br /&gt;This goes with the other application helpers:&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;  def rounded_box(&amp;block)&lt;br /&gt;    concat '&lt;div class="rounded"&gt;&lt;div class="top"&gt;&lt;/div&gt;&lt;div class="body"&gt;' + capture(&amp;block) + '&lt;/div&gt;&lt;div class="bottom"&gt;&lt;/div&gt;&lt;/div&gt;', block.binding&lt;br /&gt;  end&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;This goes in a view:&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;&lt;% rounded_box do %&gt;&lt;br /&gt;&lt;br /&gt;... stuff to put in the rounded box ...&lt;br /&gt;&lt;br /&gt;&lt;% end %&gt;&lt;br /&gt;&lt;/code&gt;</description>
      <pubDate>Fri, 17 Jun 2005 09:18:27 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/390</guid>
      <author>mdaines (Michael Daines)</author>
    </item>
  </channel>
</rss>
