<?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>Thu, 21 Aug 2008 13:28:47 GMT</pubDate>
    <description>DZone Snippets: actionview code</description>
    <item>
      <title>link_to_remote_unless_current</title>
      <link>http://snippets.dzone.com/posts/show/2183</link>
      <description>// Full discussion about this available at:&lt;br /&gt;// http://6brand.com/articles/2006/06/07/link_to_remote_unless_current&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;# throw this in one of your controller helpers.&lt;br /&gt;# it works just like a combination of link_to_unless_current and link_to_remote&lt;br /&gt;def link_to_remote_unless_current(name, options = {}, html_options = {}, *parameters_for_method_reference, &amp;block)&lt;br /&gt;  if current_page?(options[:url])&lt;br /&gt;    if block_given?&lt;br /&gt;      block.arity &lt;= 1 ? yield(name) : yield(name, remote_function(options), html_options, *parameters_for_method_reference)&lt;br /&gt;    else&lt;br /&gt;      name&lt;br /&gt;    end&lt;br /&gt;  else&lt;br /&gt;    link_to_function(name, remote_function(options), html_options)&lt;br /&gt;  end&lt;br /&gt;end&lt;br /&gt;&lt;/code&gt;</description>
      <pubDate>Wed, 14 Jun 2006 09:53:44 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/2183</guid>
      <author>danger (Danger)</author>
    </item>
  </channel>
</rss>
