<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Simone Carletti&#039;s Blog &#187; helpers</title>
	<atom:link href="http://www.simonecarletti.com/blog/tags/helpers/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.simonecarletti.com/blog</link>
	<description>Simone Carletti&#039;s personal ramblings on programming, syndication, search engines &#38; marketing.</description>
	<lastBuildDate>Thu, 12 Jan 2012 09:16:49 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Helperful 0.3.0</title>
		<link>http://www.simonecarletti.com/blog/2009/03/helperful-030/</link>
		<comments>http://www.simonecarletti.com/blog/2009/03/helperful-030/#comments</comments>
		<pubDate>Mon, 16 Mar 2009 23:46:34 +0000</pubDate>
		<dc:creator>Simone Carletti</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[gem]]></category>
		<category><![CDATA[helperful]]></category>
		<category><![CDATA[helpers]]></category>
		<category><![CDATA[plugins]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://www.simonecarletti.com/blog/?p=251</guid>
		<description><![CDATA[Available Helperful 0.3.0 with the new javascript_content_for helper.]]></description>
			<content:encoded><![CDATA[<p>Last week I released a new minor version of the <a href="http://www.simonecarletti.com/blog/2009/02/helperful-a-large-collection-of-rails-helpers/">Helperful GEM</a>. This is essentially a bugfix release, although it comes with one minor new feature: the <code>javascript_content_for</code> tag. The following overview is taken directly from the <a href="http://code.simonecarletti.com/wiki/helperful/JavascriptHelper">documentation</a>.</p>
<p>The <code>javascript_content_for</code> helper combines the features of content_for and javascript_tag into a single helper.</p>
<div class="codecolorer-container text default code-ruby" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&lt;% javascript_content_for :head do %&gt;<br />
$(&quot;#id&quot;).hide();<br />
&lt;% end %&gt;</div></td></tr></tbody></table></div>
<p>The block is passed as it is to <code>javascript_tag</code>, then the result is stored as <code>content_for :head</code>.</p>
<p>Now you can call yield and output your javascript content.</p>
<div class="codecolorer-container text default code-ruby" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&lt;%= yield :head %&gt;<br />
&lt;script&gt;$(&quot;#id&quot;).hide();&lt;/script&gt;</div></td></tr></tbody></table></div>
<p>This example is equal to the following statements.</p>
<div class="codecolorer-container text default code-ruby" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&lt;% javascript_content_for :head do; javascript_tag do %&gt; $(&quot;#id&quot;).hide(); &lt;% end; end %&gt;<br />
&lt;% javascript_content_for :head do %&gt;<br />
&lt;script&gt;$(&quot;#id&quot;).hide();&lt;/script&gt;<br />
&lt;% end %&gt;</div></td></tr></tbody></table></div>
<p>This feature also addresses an annoying bug in the <code>has_content</code> helper method caused by an undefined variable.</p>
<p>To install or upgrade:</p>
<div class="codecolorer-container text default code-bash" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">gem install weppos-helperful --source http://gems.github.com</div></td></tr></tbody></table></div>
<p>More features still to come. Visit the <a href="http://code.simonecarletti.com/helperful">project page</a> for further details.</p>
<p>Related posts<ol>
<li><a href='http://www.simonecarletti.com/blog/2009/02/helperful-a-large-collection-of-rails-helpers/' rel='bookmark' title='Helperful: a large collection of Rails Helpers'>Helperful: a large collection of Rails Helpers</a></li>
<li><a href='http://www.simonecarletti.com/blog/2009/08/ruby-on-rails-and-canonical-link-tag/' rel='bookmark' title='Ruby on Rails and Canonical link tag'>Ruby on Rails and Canonical link tag</a></li>
<li><a href='http://www.simonecarletti.com/blog/2009/10/tabsonrails-and-helperful-migrated-to-gemcutter/' rel='bookmark' title='TabsOnRails and Helperful migrated to Gemcutter'>TabsOnRails and Helperful migrated to Gemcutter</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.simonecarletti.com/blog/2009/03/helperful-030/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Helperful: a large collection of Rails Helpers</title>
		<link>http://www.simonecarletti.com/blog/2009/02/helperful-a-large-collection-of-rails-helpers/</link>
		<comments>http://www.simonecarletti.com/blog/2009/02/helperful-a-large-collection-of-rails-helpers/#comments</comments>
		<pubDate>Thu, 26 Feb 2009 08:28:19 +0000</pubDate>
		<dc:creator>Simone Carletti</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[gem]]></category>
		<category><![CDATA[helperful]]></category>
		<category><![CDATA[helpers]]></category>
		<category><![CDATA[plugins]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://www.simonecarletti.com/blog/?p=226</guid>
		<description><![CDATA[Helperful aims to be a collection of useful and reusable Rails helpers.]]></description>
			<content:encoded><![CDATA[<p><a href="http://code.simonecarletti.com/helperful">Helperful</a> aims to be a collection of useful and reusable Rails helpers.</p>
<h2>Rails Installation</h2>
<h3>As a Gem</h3>
<p>This is the preferred way to install Helperful and the best way if you want install a stable version.</p>
<div class="codecolorer-container text default brush: bash" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$ gem install weppos-helperful --source http://gems.github.com&quot;</div></td></tr></tbody></table></div>
<p>You can specify the GEM dependency in your application environment.rb file:</p>
<div class="codecolorer-container text default code-ruby" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">Rails::Initializer.run do |config|<br />
&nbsp; # other configurations<br />
&nbsp; # ...<br />
<br />
&nbsp; config.gem &quot;weppos-helperful&quot;, :lib =&gt; &quot;helperful&quot;, :source =&gt; &quot;http://gems.github.com&quot;<br />
end</div></td></tr></tbody></table></div>
<h3>As a Plugin</h3>
<p>This is the preferred way if you want to live on the edge and install a development version.</p>
<div class="codecolorer-container text default brush: bash" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$ script/plugin install git://github.com/weppos/helperful.git</div></td></tr></tbody></table></div>
<p><span id="more-226"></span></p>
<h2>Available Helpers</h2>
<p>The list of available helpers actually includes <a href="http://code.simonecarletti.com/wiki/helperful/AffiliationsHelper">AffiliationsHelper</a>, <a href="http://code.simonecarletti.com/wiki/helperful/ContentHelper">ContentHelper</a> and the more famous <a href="http://code.simonecarletti.com/wiki/helperful/TitleHelper">TitleHelper</a>.</p>
<h3>Affiliations Helper</h3>
<p>Provides a set of helpers for working with online affiliations.</p>
<p>For example, the <code>tradedoubler_verification_tag</code> helper method returns the site verification tag required by Tradedoubler to verify the publisher account ownership.</p>
<div class="codecolorer-container text default code-ruby" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"># In your template<br />
&lt;%= tradedoubler_verification_tag('00112233') %&gt;<br />
<br />
# Will produce the following output.<br />
&lt;!-- TradeDoubler site verification 00112233 --&gt;</div></td></tr></tbody></table></div>
<h3>Content Helper</h3>
<p>Provides a set of helpers for capturing and working with your page content in a more effective way.</p>
<p>Fo example, the <code>has_content?</code> helper is a natural fulfillment for the original <code>content_for</code> helper.</p>
<div class="codecolorer-container text default code-ruby" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&lt;% content_for :foo do %&gt;<br />
&lt;div&gt;This is a foo content.&lt;/div&gt;<br />
&lt;% end %&gt;<br />
<br />
&lt;% has_content? :foo &nbsp;# =&gt; true %&gt;<br />
&lt;% has_content? &quot;foo&quot; # =&gt; true %&gt;</div></td></tr></tbody></table></div>
<h3>Title Helper</h3>
<p>Provides an helper for managing page title in Rails views and layouts.</p>
<div class="codecolorer-container text default brush: ruby; html-script: true" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"># Include the helper in your controller.<br />
# You might want to include it in ApplicationController to make it available<br />
# always and everywhere in your templates.<br />
class ApplicationController &lt; ActionController::Base<br />
&nbsp; helperful :title<br />
end<br />
<br />
# Now you can use set a title in your action<br />
# Example. index.html.rb<br />
&lt;h1&gt;&lt;%= title 'This is a title' %&gt;&lt;/h1&gt;<br />
<br />
# And print the title with a :site decorator in your layout.<br />
&lt;%= title :site =&gt; 'My Cool Site!' %&gt;<br />
<br />
&lt;%= yield %&gt;</div></td></tr></tbody></table></div>
<h2>Documentation and Repository</h2>
<p>Visit the <a href="http://code.simonecarletti.com/helperful">project page</a> or the <a href="http://code.simonecarletti.com/wiki/helperful">documentation</a> for further details. The repository is <a href="http://github.com/weppos/helperful">available on GitHub</a> for forking or reference. Feel free to add more helpers and send me a pull request. Please ensure new helpers come with an appropriate test suite.</p>
<p>Related posts<ol>
<li><a href='http://www.simonecarletti.com/blog/2009/03/helperful-030/' rel='bookmark' title='Helperful 0.3.0'>Helperful 0.3.0</a></li>
<li><a href='http://www.simonecarletti.com/blog/2009/08/ruby-on-rails-and-canonical-link-tag/' rel='bookmark' title='Ruby on Rails and Canonical link tag'>Ruby on Rails and Canonical link tag</a></li>
<li><a href='http://www.simonecarletti.com/blog/2009/10/tabsonrails-and-helperful-migrated-to-gemcutter/' rel='bookmark' title='TabsOnRails and Helperful migrated to Gemcutter'>TabsOnRails and Helperful migrated to Gemcutter</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.simonecarletti.com/blog/2009/02/helperful-a-large-collection-of-rails-helpers/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

