<?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>Rails of Fury</title>
	<atom:link href="http://jondruse.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://jondruse.com</link>
	<description>a simple man :: on a mission</description>
	<lastBuildDate>Mon, 17 Aug 2009 16:33:14 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Tabbed Interface &#8211; A new rails plugin</title>
		<link>http://jondruse.com/2009/08/tabbed-interface-a-new-rails-plugin/</link>
		<comments>http://jondruse.com/2009/08/tabbed-interface-a-new-rails-plugin/#comments</comments>
		<pubDate>Mon, 17 Aug 2009 16:32:09 +0000</pubDate>
		<dc:creator>jondruse</dc:creator>
				<category><![CDATA[Rails]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[plugin]]></category>

		<guid isPermaLink="false">http://jondruse.com/?p=111</guid>
		<description><![CDATA[It&#8217;s not like we really need a new rails plugin, but this one I really saw the need for.  Tabbed interfaces can really improve how your website looks and flows. Here&#8217;s a great article from smashingmagazine about how, when and why to use tabbed interfaces. Here&#8217;s a quick rundown of the plugin.  Let <a href="http://jondruse.com/2009/08/tabbed-interface-a-new-rails-plugin/" class="more-link">More &#62;</a>]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s not like we really need a new rails plugin, but this one I really saw the need for.  Tabbed interfaces can really improve how your website looks and flows. Here&#8217;s a great article from <a href="http://www.smashingmagazine.com/2009/06/24/module-tabs-in-web-design-best-practices-and-solutions/" target="blank">smashingmagazine</a> about how, when and why to use tabbed interfaces. Here&#8217;s a quick rundown of the plugin.  Let me know what you think!</p>
<p><strong>TabbedInterface</strong></p>
<p>Build a tabbed interface very easily.  Requires Prototype.</p>
<p>see a working example at <a href="http://tab-interface.heroku.com">http://tab-interface.heroku.com<br />
</a><br />
<strong>Install</strong></p>
<p>./script/plugin install git://github.com/jondruse/tabbed_interface.git</p>
<p>Move the ajax-loader.gif from the resources folder to your public images folder, or go make one at <a href="http://www.ajaxload.info/">http://www.ajaxload.info/</a>.  Whatever you do, just make sure you call it ajax-loader.gif.</p>
<p>An example css file is also included in the resources folder.</p>
<p><strong>Example</strong></p>
<p>In this simple example we setup a TabbedInterface with two tabs.</p>
<div class="codecolorer-container ruby twitlight" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><div class="ruby codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color:#006600; font-weight:bold;">&lt;%</span> tabbed_content <span style="color:#9966CC; font-weight:bold;">do</span> <span style="color:#006600; font-weight:bold;">|</span>box<span style="color:#006600; font-weight:bold;">|</span> <span style="color:#006600; font-weight:bold;">%&gt;</span><br />
<br />
&nbsp; # You don't have to include these. &nbsp;They are the defaults, but this is how you would change them.<br />
&nbsp; <span style="color:#006600; font-weight:bold;">&lt;%</span> box.<span style="color:#9900CC;">content_wrapper</span> = <span style="color:#996600;">&quot;tabbed_content&quot;</span> <span style="color:#006600; font-weight:bold;">%&gt;</span><br />
&nbsp; <span style="color:#006600; font-weight:bold;">&lt;%</span> box.<span style="color:#9900CC;">navigation_wrapper</span> = <span style="color:#996600;">&quot;tabbed_navigation&quot;</span> <span style="color:#006600; font-weight:bold;">%&gt;</span><br />
&nbsp; <span style="color:#006600; font-weight:bold;">&lt;%</span> box.<span style="color:#9900CC;">tab_tag</span> = <span style="color:#ff3333; font-weight:bold;">:li</span> <span style="color:#006600; font-weight:bold;">%&gt;</span><br />
&nbsp; <span style="color:#006600; font-weight:bold;">&lt;%</span> box.<span style="color:#9900CC;">tabs_tag</span> = <span style="color:#ff3333; font-weight:bold;">:ul</span> <span style="color:#006600; font-weight:bold;">%&gt;</span><br />
<br />
&nbsp; # Let's add some tabs!<br />
&nbsp; # All you need is a title and a url. Also accepts two options hashes that get passed directly to the link_to_remote <br />
&nbsp; call.<br />
&nbsp; <span style="color:#006600; font-weight:bold;">&lt;%</span> box.<span style="color:#9900CC;">tab</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;Test One&quot;</span>, test_one_path, <span style="color:#006600; font-weight:bold;">&#123;</span>:method <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#ff3333; font-weight:bold;">:post</span><span style="color:#006600; font-weight:bold;">&#125;</span>, <span style="color:#006600; font-weight:bold;">&#123;</span>:<span style="color:#9966CC; font-weight:bold;">class</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">&quot;different-class&quot;</span><span style="color:#006600; font-weight:bold;">&#125;</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">%&gt;</span><br />
&nbsp; <span style="color:#006600; font-weight:bold;">&lt;%</span> box.<span style="color:#9900CC;">tab</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;Test Two&quot;</span>, test_two_path<span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">%&gt;</span><br />
&nbsp; <br />
&nbsp; <span style="color:#006600; font-weight:bold;">&lt;%</span> box.<span style="color:#9900CC;">content</span> = capture <span style="color:#9966CC; font-weight:bold;">do</span> <span style="color:#006600; font-weight:bold;">%&gt;</span><br />
&nbsp; &nbsp; # Put your default content here (probably the content for the the first tab, but doesn't have to be)<br />
&nbsp; &nbsp; Default text<br />
&nbsp; <span style="color:#006600; font-weight:bold;">&lt;%</span> <span style="color:#9966CC; font-weight:bold;">end</span> <span style="color:#006600; font-weight:bold;">%&gt;</span><br />
<br />
<span style="color:#006600; font-weight:bold;">&lt;%</span> <span style="color:#9966CC; font-weight:bold;">end</span> <span style="color:#006600; font-weight:bold;">%&gt;</span></div></div>
<p>The tabbed_content helper yields an object that has two main methods.</p>
<p>#tab</p>
<p>This method will setup a new tab header.  Just pass the title and the url to call and update the main content area.</p>
<p>#content</p>
<p>The only requirement is that you use capture (as shown above).  This sets the default content for the interface. Then when you click on a different tab, the content will be updated. You can put anything in here, but it will probably be a partial, being that the links use link_to_remote to update the main content area.  There are no limitations on how any tabs you can have, or how many interfaces you can have on a page.</p>
<p>Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://jondruse.com/2009/08/tabbed-interface-a-new-rails-plugin/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Pesky form error markup in Rails</title>
		<link>http://jondruse.com/2009/06/pesky-form-error-markup-in-rails/</link>
		<comments>http://jondruse.com/2009/06/pesky-form-error-markup-in-rails/#comments</comments>
		<pubDate>Thu, 25 Jun 2009 17:41:06 +0000</pubDate>
		<dc:creator>jondruse</dc:creator>
				<category><![CDATA[Rails]]></category>

		<guid isPermaLink="false">http://jondruse.com/?p=84</guid>
		<description><![CDATA[Have you ever spent hours coding up the most awesome form you&#8217;ve ever seen only to have Rails break it with it&#8217;s error markup?  I have, and it really sucks. So today I set out on a mission to solve this ever annoying problem.  Here&#8217;s how I did it.
Step 1. Find the source.
If <a href="http://jondruse.com/2009/06/pesky-form-error-markup-in-rails/" class="more-link">More &#62;</a>]]></description>
			<content:encoded><![CDATA[<p>Have you ever spent hours coding up the most awesome form you&#8217;ve ever seen only to have Rails break it with it&#8217;s error markup?  I have, and it really sucks. So today I set out on a mission to solve this ever annoying problem.  Here&#8217;s how I did it.</p>
<p><strong>Step 1. Find the source.</strong></p>
<p>If you&#8217;ve ever gone looking through Rails source, you know this wasn&#8217;t a very easy thing to do. But after some digging I found what was causing me so much grief.</p>
<div class="codecolorer-container ruby twitlight" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><div class="ruby codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color:#008000; font-style:italic;"># active_record_helper.rb in action_pack/action_view/helpers</span><br />
@@field_error_proc = <span style="color:#CC0066; font-weight:bold;">Proc</span>.<span style="color:#9900CC;">new</span><span style="color:#006600; font-weight:bold;">&#123;</span> <span style="color:#006600; font-weight:bold;">|</span>html_tag, instance<span style="color:#006600; font-weight:bold;">|</span> <span style="color:#996600;">&quot;&lt;div class=<span style="color:#000099;">\&quot;</span>fieldWithErrors<span style="color:#000099;">\&quot;</span>&gt;#{html_tag}&lt;/div&gt;&quot;</span> <span style="color:#006600; font-weight:bold;">&#125;</span></div></div>
<p><strong>Step 2. Figure out what you want.</strong></p>
<p>I found that the problem was that it was using a div to wrap the incorrect fields. This didn&#8217;t work for me.  I needed a span so it wouldn&#8217;t break the layout.  So what do you need?  Maybe a div works, but you want to use a different class name?  Whatever it is, figure it out.  Firebug may be of some help to you.</p>
<p><strong>Step 3.  Patch Rails.</strong></p>
<p>I love how easy this step is.  Put a file in RAILS_ROOT/config/initializers called rails_ext.rb.  You can really name this file whatever you want, but that&#8217;s what mine is called. </p>
<p>Next add these lines.</p>
<div class="codecolorer-container ruby twitlight" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><div class="ruby codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color:#9966CC; font-weight:bold;">module</span> ActionView<br />
&nbsp; <span style="color:#9966CC; font-weight:bold;">class</span> Base<br />
&nbsp; &nbsp; @@field_error_proc = <span style="color:#CC0066; font-weight:bold;">Proc</span>.<span style="color:#9900CC;">new</span><span style="color:#006600; font-weight:bold;">&#123;</span> <span style="color:#006600; font-weight:bold;">|</span>html_tag, instance<span style="color:#006600; font-weight:bold;">|</span> <span style="color:#996600;">&quot;&lt;span class=<span style="color:#000099;">\&quot;</span>fieldWithErrors<span style="color:#000099;">\&quot;</span>&gt;#{html_tag}&lt;/span&gt;&quot;</span> <span style="color:#006600; font-weight:bold;">&#125;</span><br />
&nbsp; &nbsp; cattr_accessor <span style="color:#ff3333; font-weight:bold;">:field_error_proc</span><br />
&nbsp; <span style="color:#9966CC; font-weight:bold;">end</span><br />
<span style="color:#9966CC; font-weight:bold;">end</span></div></div>
<p>Now restart your server and enjoy.</p>
<p><strong>Closing Thoughts.</strong></p>
<p>Now I know what you&#8217;re thinking.  Why don&#8217;t I just edit the css?  Well here it is.  My markup is a big deal.  If I want a span I should have a span.  I guess it really comes down to preference. Take it or leave it.</p>
]]></content:encoded>
			<wfw:commentRss>http://jondruse.com/2009/06/pesky-form-error-markup-in-rails/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Leveraging the power of inheritance in Rails.</title>
		<link>http://jondruse.com/2009/06/leveraging-the-power-of-inheritance-in-rails/</link>
		<comments>http://jondruse.com/2009/06/leveraging-the-power-of-inheritance-in-rails/#comments</comments>
		<pubDate>Tue, 23 Jun 2009 05:52:31 +0000</pubDate>
		<dc:creator>jondruse</dc:creator>
				<category><![CDATA[Rails]]></category>
		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://jondruse.com/?p=17</guid>
		<description><![CDATA[Here&#8217;s a neat trick.  It&#8217;s pretty simple but really helpful. 
Problem: You&#8217;re always setting up the same stuff in every controller.  Layouts, helper methods and so on.  
Solution: Set up your own controller to inherit from.
Throw this into a new file in the controllers folder called base_controller.rb.
class BaseController &#60; ApplicationController
&#160; 
&#160; layout &#34;base&#34;
&#160; <a href="http://jondruse.com/2009/06/leveraging-the-power-of-inheritance-in-rails/" class="more-link">More &#62;</a>]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s a neat trick.  It&#8217;s pretty simple but really helpful. </p>
<p><strong>Problem</strong>: You&#8217;re always setting up the same stuff in every controller.  Layouts, helper methods and so on.  </p>
<p><strong>Solution</strong>: Set up your own controller to inherit from.</p>
<p>Throw this into a new file in the controllers folder called base_controller.rb.</p>
<div class="codecolorer-container ruby twitlight" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><div class="ruby codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color:#9966CC; font-weight:bold;">class</span> BaseController <span style="color:#006600; font-weight:bold;">&lt;</span> ApplicationController<br />
&nbsp; <br />
&nbsp; layout <span style="color:#996600;">&quot;base&quot;</span><br />
&nbsp; helper <span style="color:#ff3333; font-weight:bold;">:my_cool_helper</span> &nbsp;<br />
<br />
<span style="color:#9966CC; font-weight:bold;">end</span></div></div>
<p>Now take any controller and change the first line like below.  Now anything in BaseController you get for free.  So in the example below, PostsController&#8217;s layout will be &#8220;base&#8221; and will have the MyCoolHelper included also.</p>
<div class="codecolorer-container ruby twitlight" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><div class="ruby codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color:#9966CC; font-weight:bold;">class</span> PostsController <span style="color:#006600; font-weight:bold;">&lt;</span> BaseController<br />
<br />
&nbsp; <span style="color:#9966CC; font-weight:bold;">def</span> list<br />
&nbsp; <span style="color:#9966CC; font-weight:bold;">end</span><br />
<br />
<span style="color:#9966CC; font-weight:bold;">end</span></div></div>
<p>Wow, that was easy.  Now it&#8217;s much easier to make (and change) default behaviors in your app.  Hope this helps you, it sure helped me.</p>
]]></content:encoded>
			<wfw:commentRss>http://jondruse.com/2009/06/leveraging-the-power-of-inheritance-in-rails/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Git Documentation for Apple Dictionary</title>
		<link>http://jondruse.com/2009/06/git-documentation-for-apple-dictionary/</link>
		<comments>http://jondruse.com/2009/06/git-documentation-for-apple-dictionary/#comments</comments>
		<pubDate>Mon, 01 Jun 2009 16:14:52 +0000</pubDate>
		<dc:creator>jondruse</dc:creator>
				<category><![CDATA[Git]]></category>

		<guid isPermaLink="false">http://jondruse.com/?p=20</guid>
		<description><![CDATA[A couple months ago I found Priit Haamer&#8217;s blog post about the Ruby Dictionary for Mac OS X. So now I&#8217;ve ported the Git Documentation to Dictionary.app also. Please let me know of any bugs.  Enjoy!
Download




Download gitdictionary file (&#60;1MB, works only with 10.5 Leopard) and proceed to installation instructions.


Installation



Unzip downloaded file into ~/Library/Dictionaries folder if <a href="http://jondruse.com/2009/06/git-documentation-for-apple-dictionary/" class="more-link">More &#62;</a>]]></description>
			<content:encoded><![CDATA[<p>A couple months ago I found Priit Haamer&#8217;s blog post about the <a href="http://priithaamer.com/blog/ruby-dictionary-for-mac-os-x">Ruby Dictionary for Mac OS X</a>. So now I&#8217;ve ported the Git Documentation to Dictionary.app also. Please let me know of any bugs.  Enjoy!</p>
<div><strong>Download</strong></div>
<div><strong><br />
</strong></div>
<div>
<ol>
<li>Download <a href="http://jondruse.com/wp-content/uploads/2009/06/gitdictionary.zip">gitdictionary</a> file <span style="font-weight: bold;">(&lt;1MB, works only with 10.5 Leopard)</span> and proceed to installation instructions.</li>
</ol>
</div>
<div><strong>Installation</strong></div>
<div><strong><br />
</strong></div>
<ol>
<li>Unzip downloaded file into <span style="font-weight: bold;">~/Library/Dictionaries</span> folder if you want to keep this dictionary only for yourself. You may need to create this folder if you haven&#8217;t installed any dictionaries before.</li>
<li>To make the searching with Spotlight work, open Dictionary.app preferences pane and drag &#8220;Git&#8221; from the dictionaries list from bottom to the top because only the first one in this list will be searched from Spotlight.</li>
<li>To make it available for all users on your computer, drop the <span style="font-weight: bold;">Git.dictionary</span> folder into <span style="font-weight: bold;">/Library/Dictionaries</span> folder.</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://jondruse.com/2009/06/git-documentation-for-apple-dictionary/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
