<?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>Sam Pierson&#039;s Blog &#187; rails</title>
	<atom:link href="http://sampierson.com/blog/tag/rails/feed/" rel="self" type="application/rss+xml" />
	<link>http://sampierson.com/blog</link>
	<description>Augmentation of an Imperfect Memory.</description>
	<lastBuildDate>Wed, 21 Jul 2010 01:41:32 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>How to optimize a Solr index from Sunspot</title>
		<link>http://sampierson.com/blog/software-development/how-to-optimize-a-solr-index-from-sunspot/</link>
		<comments>http://sampierson.com/blog/software-development/how-to-optimize-a-solr-index-from-sunspot/#comments</comments>
		<pubDate>Sat, 17 Jul 2010 03:37:10 +0000</pubDate>
		<dc:creator>sam</dc:creator>
				<category><![CDATA[Software Development]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[solr]]></category>
		<category><![CDATA[sunspot]]></category>

		<guid isPermaLink="false">http://sampierson.com/blog/?p=678</guid>
		<description><![CDATA[It doesn&#8217;t look like SunSpot has a builtin optimize command.
Here&#8217;s one way you can do it:

&#160;
Sunspot.session.session.send&#40;:connection&#41;.update RSolr::Message::Generator.new.build &#123; &#124;b&#124; b.optimize &#125;

Anyone know of a simpler one?
]]></description>
			<content:encoded><![CDATA[<p>It doesn&#8217;t look like SunSpot has a builtin optimize command.<br />
Here&#8217;s one way you can do it:</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;">&nbsp;
Sunspot.<span style="color:#9900CC;">session</span>.<span style="color:#9900CC;">session</span>.<span style="color:#9900CC;">send</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#ff3333; font-weight:bold;">:connection</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color:#9900CC;">update</span> <span style="color:#6666ff; font-weight:bold;">RSolr::Message::Generator</span>.<span style="color:#9900CC;">new</span>.<span style="color:#9900CC;">build</span> <span style="color:#006600; font-weight:bold;">&#123;</span> <span style="color:#006600; font-weight:bold;">|</span>b<span style="color:#006600; font-weight:bold;">|</span> b.<span style="color:#9900CC;">optimize</span> <span style="color:#006600; font-weight:bold;">&#125;</span></pre></div></div>

<p>Anyone know of a simpler one?</p>
]]></content:encoded>
			<wfw:commentRss>http://sampierson.com/blog/software-development/how-to-optimize-a-solr-index-from-sunspot/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Resque</title>
		<link>http://sampierson.com/blog/software-development/resque/</link>
		<comments>http://sampierson.com/blog/software-development/resque/#comments</comments>
		<pubDate>Fri, 19 Mar 2010 03:15:14 +0000</pubDate>
		<dc:creator>sam</dc:creator>
				<category><![CDATA[Software Development]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[redis]]></category>
		<category><![CDATA[resque]]></category>

		<guid isPermaLink="false">http://sampierson.com/blog/?p=683</guid>
		<description><![CDATA[Github&#8217;s excellent analysis of the extant background jobs runners and introduction to Resque
]]></description>
			<content:encoded><![CDATA[<p>Github&#8217;s excellent analysis of the extant background jobs runners and <a href="http://github.com/blog/542-introducing-resque">introduction to Resque</a></p>
]]></content:encoded>
			<wfw:commentRss>http://sampierson.com/blog/software-development/resque/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>RubyMine not recognizing cucumber features</title>
		<link>http://sampierson.com/blog/software-development/rubymine-not-recognizing-cucumber-features/</link>
		<comments>http://sampierson.com/blog/software-development/rubymine-not-recognizing-cucumber-features/#comments</comments>
		<pubDate>Mon, 15 Feb 2010 22:19:23 +0000</pubDate>
		<dc:creator>sam</dc:creator>
				<category><![CDATA[Software Development]]></category>
		<category><![CDATA[cucumber]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[rubymine]]></category>

		<guid isPermaLink="false">http://sampierson.com/blog/?p=658</guid>
		<description><![CDATA[If RubyMine isn&#8217;t recognizing cucumber features, ensure the following:

Cucumber gem is attached to project: RM &#124; Settings &#124; Ruby SDK and Gems &#124; Attach gems.
If you edited *.feature files in early version of RubyMine it may be mapped on Text file. So you should check that *.feature extension is mapped on &#8220;Cucumber scenario files&#8221; in [...]]]></description>
			<content:encoded><![CDATA[<p>If RubyMine isn&#8217;t recognizing cucumber features, ensure the following:</p>
<ol>
<li>Cucumber gem is attached to project: RM | Settings | Ruby SDK and Gems | Attach gems.</li>
<li>If you edited *.feature files in early version of RubyMine it may be mapped on Text file. So you should check that *.feature extension is mapped on &#8220;Cucumber scenario files&#8221; in RM | Settings | File Types |  Recognized File Types.</li>
</ol>
<p>per <a href="http://www.jetbrains.net/devnet/message/5238832#5238832">Roman at JetBrains</a></p>
]]></content:encoded>
			<wfw:commentRss>http://sampierson.com/blog/software-development/rubymine-not-recognizing-cucumber-features/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to stop ActiveRecord putting attribute name in validation message</title>
		<link>http://sampierson.com/blog/software-development/how-to-stop-activerecord-putting-attribute-name-in-validation-message/</link>
		<comments>http://sampierson.com/blog/software-development/how-to-stop-activerecord-putting-attribute-name-in-validation-message/#comments</comments>
		<pubDate>Wed, 02 Sep 2009 20:43:12 +0000</pubDate>
		<dc:creator>sam</dc:creator>
				<category><![CDATA[Software Development]]></category>
		<category><![CDATA[ActiveRecord]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://sampierson.com/blog/?p=591</guid>
		<description><![CDATA[Use http://github.com/gumayunov/custom-err-msg/tree/master
Put a ^ at the start of the :message =&#62; option:
Non-base messages are prefixed with the attribute name as usual UNLESS they begin with '^'
 in which case the attribute name is omitted.
]]></description>
			<content:encoded><![CDATA[<p>Use http://github.com/gumayunov/custom-err-msg/tree/master</p>
<p>Put a ^ at the start of the :message =&gt; option:</p>
<pre style="font: normal normal normal 115%/normal Monaco, 'Courier New', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', monospace; line-height: 1.4em; font-family: 'Bitstream Vera Sans Mono', Courier, monospace; font-size: 11px; color: #444444; padding: 0px; margin: 0px;">Non-base messages are prefixed with the attribute name as usual UNLESS they begin with '^'
 in which case the attribute name is omitted.</pre>
]]></content:encoded>
			<wfw:commentRss>http://sampierson.com/blog/software-development/how-to-stop-activerecord-putting-attribute-name-in-validation-message/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Paperclip/ImageMagick image geometry specifiers</title>
		<link>http://sampierson.com/blog/software-development/paperclipimagemagick-image-geometry-specifiers/</link>
		<comments>http://sampierson.com/blog/software-development/paperclipimagemagick-image-geometry-specifiers/#comments</comments>
		<pubDate>Wed, 02 Sep 2009 20:36:43 +0000</pubDate>
		<dc:creator>sam</dc:creator>
				<category><![CDATA[Software Development]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://sampierson.com/blog/?p=589</guid>
		<description><![CDATA[This can be a pain to find so here is the quick access version:
&#60;width&#62;x&#60;height&#62;&#60;specifier&#62;
% Interpret width and height as a percentage of the current size.
! Resize to width and height exactly, loosing original aspect ratio.
&#60; Resize only if the image is smaller than the geometry specification.
&#62; Resize only if the image is greater than the [...]]]></description>
			<content:encoded><![CDATA[<p>This can be a pain to find so here is the quick access version:</p>
<p>&lt;width&gt;x&lt;height&gt;&lt;specifier&gt;</p>
<p>% Interpret width and height as a percentage of the current size.<br />
! Resize to width and height exactly, loosing original aspect ratio.<br />
&lt; Resize only if the image is smaller than the geometry specification.<br />
&gt; Resize only if the image is greater than the geometry specification.</p>
]]></content:encoded>
			<wfw:commentRss>http://sampierson.com/blog/software-development/paperclipimagemagick-image-geometry-specifiers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Switching an ActiveRecord instance between STI classes</title>
		<link>http://sampierson.com/blog/software-development/switching-an-activerecord-instance-between-sti-classes/</link>
		<comments>http://sampierson.com/blog/software-development/switching-an-activerecord-instance-between-sti-classes/#comments</comments>
		<pubDate>Fri, 28 Aug 2009 07:11:16 +0000</pubDate>
		<dc:creator>sam</dc:creator>
				<category><![CDATA[Software Development]]></category>
		<category><![CDATA[ActiveRecord]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://sampierson.com/blog/?p=582</guid>
		<description><![CDATA[Sometimes you wish to convert one STI class to another, e.g. promote User to Administrator.
ActiveRecord::Base#becomes(Klass) returns an instance of the current record converted to the specified Klass, e.g.:

&#160;
user = User.find_by_login&#40;&#34;sam&#34;&#41;
user.becomes&#40;Administrator&#41;

Note however that this does not change the type attribute of the instance, so you still have an additional step to do if you want this [...]]]></description>
			<content:encoded><![CDATA[<p>Sometimes you wish to convert one STI class to another, e.g. promote User to Administrator.</p>
<p>ActiveRecord::Base#becomes(Klass) returns an instance of the current record converted to the specified Klass, e.g.:</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;">&nbsp;
user = User.<span style="color:#9900CC;">find_by_login</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;sam&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
user.<span style="color:#9900CC;">becomes</span><span style="color:#006600; font-weight:bold;">&#40;</span>Administrator<span style="color:#006600; font-weight:bold;">&#41;</span></pre></div></div>

<p>Note however that this does not change the type attribute of the instance, so you still have an additional step to do if you want this conversion to be permanent.</p>
]]></content:encoded>
			<wfw:commentRss>http://sampierson.com/blog/software-development/switching-an-activerecord-instance-between-sti-classes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SV-Ruby Meetup, 2009-03-19</title>
		<link>http://sampierson.com/blog/software-development/sv-ruby-meetup-2009-03-19/</link>
		<comments>http://sampierson.com/blog/software-development/sv-ruby-meetup-2009-03-19/#comments</comments>
		<pubDate>Fri, 20 Mar 2009 03:15:49 +0000</pubDate>
		<dc:creator>sam</dc:creator>
				<category><![CDATA[Software Development]]></category>
		<category><![CDATA[meetup]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://sampierson.com/blog/?p=490</guid>
		<description><![CDATA[Yehuda Katz talked about Rails 3
Rails API should not change!  It&#8217;s a mistake to change the API and the implementation at the same time (think Ruby 1.9 language and VM).
 ORM Agnisticism
With for_for @obj, @obj can be an ActiveRecord, DataMapper, CouchDB, SimpleDB, Sequel object.  Two interfaces are now support for ORM objects, ActiveRecord/DataMapper style: errors, #each, [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Yehuda Katz</strong> talked about <strong>Rails 3</strong></p>
<p>Rails API should not change!  It&#8217;s a mistake to change the API and the implementation at the same time (think Ruby 1.9 language and VM).</p>
<p><strong> ORM Agnisticism</strong></p>
<p>With <em>for_for @obj, </em>@obj can be an ActiveRecord, DataMapper, CouchDB, SimpleDB, Sequel object.  Two interfaces are now support for ORM objects, ActiveRecord/DataMapper style: <em>errors, #each, #join </em>and Sequel style: <em>errors, #to_str.<br />
</em>Under the covers:     Works with any ORM that codes to the interface:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
</pre></td><td class="code"><pre class="foo" style="font-family:monospace;">ActionORM::Drivers::AbstractDriver
initialize
new_record?
errors
valid?</pre></td></tr></table></div>

<p>Sequel will provide a proxy for their users, an adapter to ActiveRecord API.  Inside Rails, the only line that changed is:</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;">objects.<span style="color:#9900CC;">map</span>! <span style="color:#006600; font-weight:bold;">&#123;</span> <span style="color:#006600; font-weight:bold;">|</span>o<span style="color:#006600; font-weight:bold;">|</span> ActionORM.<span style="color:#9966CC; font-weight:bold;">for</span><span style="color:#006600; font-weight:bold;">&#40;</span>o<span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#125;</span></pre></div></div>

<p>Makes writing plugins easier.</p>
<p><strong>Rack</strong></p>
<ul>
<li>Is an abstraction between servers (Mongrel Thin Webrick IRB CGI Runner Eb FCGI) and Rails/Merb.</li>
<li>Prefork &#8211; efficient parallelization.</li>
<li>Middleware:     build up pipes of stuff between the server and Merb/Rails</li>
<li>Rails 2.3: Sessions is middleware, Failsafe is middlware.  To use in Rails 2.3, do: <em>config.middlware.use  Foo</em></li>
</ul>
<p>Router can now route to RailsController or MerbController or RailsRouter or SinatraApp,     it really doesn&#8217;t matter.</p>
<p><strong>AbstractController</strong></p>
<p>A pluggable API for building controllers.  Add what you want: dispatch, callbacks etc, leave out what you don&#8217;t want.</p>
<p><strong>Public / Private / Plugin API</strong></p>
<p>Rails had a public API and everything else was :nodoc:.  Trouble with that was that there was no stable interface for plugin writers to implement against.</p>
<p><strong>Rack::Bug</strong></p>
<p>Debug toolbar based on Django Debug Toolbar.  Made pluggable with Orchestra &#8211; a pub/sub framework for streaming instrumentation events that Yehuda just started.  Lower impact.  Will work for New Relic, Five Runs, etc.</p>
<p>Exception Middleware</p>
<p><strong>JavaScript</strong></p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;form class=&quot;remote&quot; method=&quot;post&quot;, ...</pre></div></div>

<p>Then in rails.jquery.js</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;form.remote&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">live</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;submit&quot;</span><span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> $this.<span style="color: #660066;">ajaxSubmit</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span></pre></div></div>

<p>Replace it with rails.you!.js</p>
<p><strong>Performance</strong></p>
<p>Ruby 1.9 is now 2nd fastest dynamic language at 50x slower than C++.  Python2 is the fastest (40x), PHP is the new loser (100x) now that Ruby 1.8.6 (150x) is gone.</p>
<p><strong>Rails Boost</strong></p>
<p>Build you own custom rails stack.  Pick templating language, pick javascript framework&#8230;</p>
<p><strong>Competition</strong></p>
<p>Plugin APIs allow everyone to compete in the area they are interested in, without having to write an entire framework.</p>
<p><strong>Schedule</strong></p>
<p>Alpha for Railsconf. Need something to give to plugin writers.  Would like to get it released by EOY.</p>
]]></content:encoded>
			<wfw:commentRss>http://sampierson.com/blog/software-development/sv-ruby-meetup-2009-03-19/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ActiveRecord performance: validation and associations</title>
		<link>http://sampierson.com/blog/software-development/rails-performance-and-validation/</link>
		<comments>http://sampierson.com/blog/software-development/rails-performance-and-validation/#comments</comments>
		<pubDate>Thu, 12 Mar 2009 07:07:03 +0000</pubDate>
		<dc:creator>sam</dc:creator>
				<category><![CDATA[Software Development]]></category>
		<category><![CDATA[ActiveRecord]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://sampierson.com/blog/?p=475</guid>
		<description><![CDATA[If you have two models associated in some way, it is usual to add a validates_presence_of validator to ensure that the models are connected before saving. However, be aware that there are two ways of doing this with different performance ramifications:

class BlogEntry &#60; ActiveRecord::Base
  belongs_to :blog
  validate_presence_of :blog
end

During validation, Validates_presence_of :blog causes ActiveRecord [...]]]></description>
			<content:encoded><![CDATA[<p>If you have two models associated in some way, it is usual to add a validates_presence_of validator to ensure that the models are connected before saving. However, be aware that there are two ways of doing this with different performance ramifications:</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#9966CC; font-weight:bold;">class</span> BlogEntry <span style="color:#006600; font-weight:bold;">&lt;</span> <span style="color:#6666ff; font-weight:bold;">ActiveRecord::Base</span>
  belongs_to <span style="color:#ff3333; font-weight:bold;">:blog</span>
  validate_presence_of <span style="color:#ff3333; font-weight:bold;">:blog</span>
<span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>

<p>During validation, <em>Validates_presence_of :blog</em> causes ActiveRecord to call <em>self#blog</em> to see if it is nil. As this is the name of the association it will cause AR to retrieve the associated record from the DB before ascertaining if it is nil.  E.g. with Rails 2.2.2:</p>
<pre>&gt;&gt; e = BlogEntry.find(1)
  BlogEntry Load (0.3ms)   SELECT * FROM "blog_entries" WHERE ("blog_entries"."id" = 1)
=&gt; #
&gt;&gt; e.valid?
  Blog Load (0.3ms)   SELECT * FROM "blogs" WHERE ("blogs"."id" = 1)
=&gt; true</pre>
<p>If you are confident of your database integrity, you can do <em>validates_presence_of :blog_id</em> instead.  This will save you an SQL query.  In a model that is saved frequently, this can be quite beneficial.</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#9966CC; font-weight:bold;">class</span> BlogEntry <span style="color:#006600; font-weight:bold;">&lt;</span> <span style="color:#6666ff; font-weight:bold;">ActiveRecord::Base</span>
  belongs_to <span style="color:#ff3333; font-weight:bold;">:blog</span>
  validate_presence_of <span style="color:#ff3333; font-weight:bold;">:blog_id</span>
<span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://sampierson.com/blog/software-development/rails-performance-and-validation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Testing Rails routes</title>
		<link>http://sampierson.com/blog/software-development/testing-rails-routes/</link>
		<comments>http://sampierson.com/blog/software-development/testing-rails-routes/#comments</comments>
		<pubDate>Wed, 24 Dec 2008 20:45:39 +0000</pubDate>
		<dc:creator>sam</dc:creator>
				<category><![CDATA[Software Development]]></category>
		<category><![CDATA[rails]]></category>

		<guid isPermaLink="false">http://sampierson.com/blog/?p=318</guid>
		<description><![CDATA[The other thing I can never remember off the top of my head:


1
2
3
4
5
6
7
8
9
&#62;&#62; r = ActionController::Routing::Routes
&#160;
&#62;&#62; r.recognize_path '/perspective/edit_wizard/1', :method =&#62; :get
&#160;
&#62; &#123;:action=&#62;&#34;edit_wizard&#34;, :id=&#62;&#34;1&#34;, :controller=&#62;&#34;perspective&#34;&#125;
&#160;
&#62;&#62; r.generate :action=&#62; &#34;edit_wizard&#34;, :id=&#62; &#34;1&#34;, :controller=&#62; &#34;perspective&#34;
&#160;
&#62; &#34;/perspective/edit_wizard/1&#34;

]]></description>
			<content:encoded><![CDATA[<p>The other thing I can never remember off the top of my head:<br />
<br/></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
</pre></td><td class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#006600; font-weight:bold;">&gt;&gt;</span> r = <span style="color:#6666ff; font-weight:bold;">ActionController::Routing::Routes</span>
&nbsp;
<span style="color:#006600; font-weight:bold;">&gt;&gt;</span> r.<span style="color:#9900CC;">recognize_path</span> <span style="color:#996600;">'/perspective/edit_wizard/1'</span>, <span style="color:#ff3333; font-weight:bold;">:method</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#ff3333; font-weight:bold;">:get</span>
&nbsp;
<span style="color:#006600; font-weight:bold;">&gt;</span> <span style="color:#006600; font-weight:bold;">&#123;</span>:action<span style="color:#006600; font-weight:bold;">=&gt;</span><span style="color:#996600;">&quot;edit_wizard&quot;</span>, <span style="color:#ff3333; font-weight:bold;">:id</span><span style="color:#006600; font-weight:bold;">=&gt;</span><span style="color:#996600;">&quot;1&quot;</span>, <span style="color:#ff3333; font-weight:bold;">:controller</span><span style="color:#006600; font-weight:bold;">=&gt;</span><span style="color:#996600;">&quot;perspective&quot;</span><span style="color:#006600; font-weight:bold;">&#125;</span>
&nbsp;
<span style="color:#006600; font-weight:bold;">&gt;&gt;</span> r.<span style="color:#9900CC;">generate</span> <span style="color:#ff3333; font-weight:bold;">:action</span><span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">&quot;edit_wizard&quot;</span>, <span style="color:#ff3333; font-weight:bold;">:id</span><span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">&quot;1&quot;</span>, <span style="color:#ff3333; font-weight:bold;">:controller</span><span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">&quot;perspective&quot;</span>
&nbsp;
<span style="color:#006600; font-weight:bold;">&gt;</span> <span style="color:#996600;">&quot;/perspective/edit_wizard/1&quot;</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://sampierson.com/blog/software-development/testing-rails-routes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ActionController::Base.helpers proxy</title>
		<link>http://sampierson.com/blog/tidbits/actioncontrollerbasehelpers-proxy/</link>
		<comments>http://sampierson.com/blog/tidbits/actioncontrollerbasehelpers-proxy/#comments</comments>
		<pubDate>Thu, 30 Oct 2008 16:08:07 +0000</pubDate>
		<dc:creator>sam</dc:creator>
				<category><![CDATA[Tidbits]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[railscast]]></category>

		<guid isPermaLink="false">http://sampierson.com/blog/?p=283</guid>
		<description><![CDATA[Tidbit from RailsCast 132:
ActionController::Base.helpers is a proxy object you can use to access Rails view helpers, outside of views, e.g.:


1
ActionController::Base.helpers.pulralize(products.count, 'product')

]]></description>
			<content:encoded><![CDATA[<p>Tidbit from <a href="http://railscasts.com/episodes/132-helpers-outside-views">RailsCast 132</a>:</p>
<p>ActionController::Base.helpers is a proxy object you can use to access Rails view helpers, outside of views, e.g.:<br />
<br/></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="language" style="font-family:monospace;">ActionController::Base.helpers.pulralize(products.count, 'product')</pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://sampierson.com/blog/tidbits/actioncontrollerbasehelpers-proxy/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
