<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/css" href="/stylesheets/rss.css"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
  <channel>
    <title>Streamlined: New in Edge: Render Filters</title>
    <link>http://streamlinedframework.org/articles/2007/06/25/new-in-streamlined-render-filters</link>
    <language>en-us</language>
    <ttl>40</ttl>
    <description>Stop banging rocks together and build something</description>
    <item>
      <title>New in Edge: Render Filters</title>
      <description>&lt;p&gt;We&amp;#8217;re excited to announce a new feature in Edge that will make it much easier to use Streamlined&amp;#8217;s default actions while still having control over what gets rendered afterwards. Render filters allow you to tack additional code onto the end of a default action.&lt;/p&gt;


	&lt;p&gt;Matthew demonstrated these filters in a very early form at the Streamlined tutorial at RailsConf last month. They have since become much more useful and flexible. By using these filters, we&amp;#8217;ve been able to stop copying and pasting default actions into our controllers only to make a single small change. Now, we can make the small change declaratively &lt;i&gt;without&lt;/i&gt; redefining the action.&lt;/p&gt;


	&lt;p&gt;For example, what if you prefer that Streamlined redirect back to the list view instead of the show view after updating a record? You would add this render filter to your controller:&lt;/p&gt;


&lt;pre&gt;
render_filter :update, :success =&amp;gt; Proc.new {
  redirect_to :action =&amp;gt; 'list'
}
&lt;/pre&gt;

	&lt;p&gt;What this says is that the Streamlined&amp;#8217;s default update action should
redirect back to the list action on success. (Render paths can also be
defined for failure.)&lt;/p&gt;


	&lt;p&gt;The contents of the Proc are called in the context of the controller
action itself, allowing you to redirect, assign new instance vars,
etc. (Pretty much anything you can do inside a controller action.)&lt;/p&gt;


	&lt;p&gt;More examples and documentation can be found &lt;a href="http://trac.streamlinedframework.org/wiki/RenderFilters"&gt;on the wiki&lt;/a&gt;.&lt;/p&gt;</description>
      <pubDate>Mon, 25 Jun 2007 09:43:00 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:622b9b20-31f4-4fa7-962b-0187a692698a</guid>
      <author>Matthew</author>
      <link>http://streamlinedframework.org/articles/2007/06/25/new-in-streamlined-render-filters</link>
      <category>Features</category>
      <trackback:ping>http://streamlinedframework.org/articles/trackback/134</trackback:ping>
    </item>
    <item>
      <title>"New in Edge: Render Filters" by Jason Rudolph</title>
      <description>&lt;p&gt;Thanks, CN.  The link is now updated to point to the new address.&lt;/p&gt;</description>
      <pubDate>Wed, 04 Jul 2007 09:58:04 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:ef225b55-258c-4b91-a358-289df99531cd</guid>
      <link>http://streamlinedframework.org/articles/2007/06/25/new-in-streamlined-render-filters#comment-137</link>
    </item>
    <item>
      <title>"New in Edge: Render Filters" by CN</title>
      <description>&lt;p&gt;Please update the link for the WIKI in this post&amp;#8230; It links to the old address.&lt;/p&gt;


	&lt;p&gt;Cheers&lt;/p&gt;</description>
      <pubDate>Wed, 04 Jul 2007 06:32:43 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:1afdcbb2-2206-465c-817e-8194681a5d1e</guid>
      <link>http://streamlinedframework.org/articles/2007/06/25/new-in-streamlined-render-filters#comment-136</link>
    </item>
  </channel>
</rss>
