<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.clearcrystalmedia.com/~d/styles/itemcontent.css"?><rss 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/" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>Polymorphism</title>
	
	<link>http://www.clearcrystalmedia.com/pm</link>
	<description>using the right technology at the right time</description>
	<lastBuildDate>Sat, 14 Aug 2010 18:10:22 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.clearcrystalmedia.com/polymorphism" /><feedburner:info uri="polymorphism" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><geo:lat>39.965131</geo:lat><geo:long>-83.004316</geo:long><feedburner:emailServiceId>polymorphism</feedburner:emailServiceId><feedburner:feedburnerHostname>http://feedburner.google.com</feedburner:feedburnerHostname><item>
		<title>Improving the tutorial (again): including partials to DRY up forms in Wheels</title>
		<link>http://feeds.clearcrystalmedia.com/~r/polymorphism/~3/Hfeq7ChBbds/</link>
		<comments>http://www.clearcrystalmedia.com/pm/including-partials-dry-forms-cfwheels/#comments</comments>
		<pubDate>Sat, 14 Aug 2010 17:39:12 +0000</pubDate>
		<dc:creator>Chris Peters</dc:creator>
				<category><![CDATA[ColdFusion on Wheels]]></category>

		<guid isPermaLink="false">http://www.clearcrystalmedia.com/pm/?p=511</guid>
		<description><![CDATA[<p>This past week, <a href="http://kwbarrett.wordpress.com/">Kenneth Barrett</a> asked a question on Twitter about <a href="http://twitter.com/kwbarrett/status/20989029404">how to <acronym title="Don't Repeat Yourself">DRY</acronym> up his form code in ColdFusion on Wheels</a>. He didn't want to have a copy of the same form across 2 view files. This is because he is a smart guy, even as a beginner! :)</p>
<p>I linked Kenneth to a post that I wrote a year ago about <a href="http://www.clearcrystalmedia.com/pm/same-view-multiple-actions-coldfusion-on-wheels/">combining 2 forms into a single view file</a>. That approach works well for certain scenarios, but I've since changed my mind on my general preference for <acronym title="Don't Repeat Yourself">DRY</acronym>ing up forms.</p>
<p>Read on to see what exactly I've changed my mind on.</p>]]></description>
			<content:encoded><![CDATA[<p>This past week, <a href="http://kwbarrett.wordpress.com/">Kenneth Barrett</a> asked a question on Twitter about <a href="http://twitter.com/kwbarrett/status/20989029404">how to <acronym title="Don't Repeat Yourself">DRY</acronym> up his form code in ColdFusion on Wheels</a>. He didn&#8217;t want to have a copy of the same form across 2 view files. This is because he is a smart guy, even as a beginner! <img src='http://www.clearcrystalmedia.com/pm/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>I linked Kenneth to a post that I wrote a year ago about <a href="http://www.clearcrystalmedia.com/pm/same-view-multiple-actions-coldfusion-on-wheels/">combining 2 forms into a single view file</a>. That approach works well for certain scenarios, but I&#8217;ve since changed my mind on my general preference for <acronym title="Don't Repeat Yourself">DRY</acronym>ing up forms.</p>
<h2>How the previous approach affects workflow</h2>
<p>Really, what&#8217;s caused my change of heart is driven by how my mind works when I&#8217;m maintaining an application. It&#8217;s important to constantly be thinking about this so we can make the boring stuff (maintenance) more efficient so we can spend more time on the fun stuff (innovation! creating new things!).</p>
<p>When I&#8217;m maintaining my Wheels application, I am sometimes in &#8220;view mode&#8221; or &#8220;data mode.&#8221; That will change the perspective on how I&#8217;m thinking about and approaching my application. If I&#8217;m in &#8220;view mode,&#8221; I&#8217;ll often start digging around in the files in the <kbd>views</kbd> folder without any regard for the <abbr title="ColdFusion Component">CFC</abbr>s stored in the <kbd>controllers</kbd> or <kbd>models</kbd> folders.</p>
<p>So if I want to change what happens on the form at <kbd>views/users/add.cfm</kbd>, that&#8217;s what I&#8217;m going to look for. Personally, I find that it&#8217;s annoying if I don&#8217;t find that particular view template and need to open the controller file to figure out what&#8217;s going on.</p>
<h2>New approach: partials</h2>
<p>Now I usually create <a href="http://cfwheels.org/docs/chapter/partials">partials</a> to represent the pieces of code that need to be represented across several view templates. As you&#8217;ll see, this eliminates a lot of unneeded logic in the parent view templates as well as removing the need to set up so many variables in the controller actions.</p>
<p>Here is the new <kbd>views/users/add.cfm</kbd> with a partial call:</p>

<div class="wp_syntax"><div class="code"><pre class="cfm" style="font-family:monospace;"><span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cfparam</span> <span style="color: #0000FF;">name</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;user&quot;</span><span style="color: #0000FF;">&gt;</span></span>
&nbsp;
<span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cfoutput</span><span style="color: #0000FF;">&gt;</span></span>
&nbsp;
<span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #000000; font-weight: bold;">h1</span><span style="color: #0000FF;">&gt;</span></span>Create a New User<span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #000000; font-weight: bold;">h1</span><span style="color: #0000FF;">&gt;</span></span>
&nbsp;
<span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cfif</span> flashKeyExists<span style="color: #0000FF;">&#40;</span><span style="color: #009900;">&quot;success&quot;</span><span style="color: #0000FF;">&#41;</span><span style="color: #0000FF;">&gt;</span></span>
    <span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #000000; font-weight: bold;">p</span> <span style="color: #0000FF;">class</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;success&quot;</span><span style="color: #0000FF;">&gt;</span></span>#flash(&quot;success&quot;)#<span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #000000; font-weight: bold;">p</span><span style="color: #0000FF;">&gt;</span></span>
<span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #990000; font-weight: bold;">cfif</span><span style="color: #0000FF;">&gt;</span></span>
&nbsp;
#startFormTag(action=&quot;create&quot;)#
&nbsp;
<span style="color: #0000FF;">#includePartial<span style="color: #0000FF;">&#40;</span>user<span style="color: #0000FF;">&#41;</span>#</span>
<span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #000000; font-weight: bold;">div</span><span style="color: #0000FF;">&gt;</span></span>
    #submitTag(value=&quot;Create&quot;)#
<span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #000000; font-weight: bold;">div</span><span style="color: #0000FF;">&gt;</span></span>
&nbsp;
<span style="color: #0000FF;">#endFormTag<span style="color: #0000FF;">&#40;</span><span style="color: #0000FF;">&#41;</span>#</span>
&nbsp;
<span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #990000; font-weight: bold;">cfoutput</span><span style="color: #0000FF;">&gt;</span></span></pre></div></div>

<p>And now that I&#8217;m passing the <code>user</code> object to <code>includePartial()</code>, Wheels will auto-include the partial at <kbd>views/users/_user.cfm</kbd>:</p>

<div class="wp_syntax"><div class="code"><pre class="cfm" style="font-family:monospace;"><span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cfparam</span> <span style="color: #0000FF;">name</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;user&quot;</span><span style="color: #0000FF;">&gt;</span></span>
&nbsp;
<span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cfoutput</span><span style="color: #0000FF;">&gt;</span></span>
&nbsp;
#textField(objectName=&quot;user&quot;, property=&quot;name&quot;, label=&quot;Name&quot;)#
#textField(objectName=&quot;user&quot;, property=&quot;email&quot;, label=&quot;Email&quot;)#
#passwordField(objectName=&quot;user&quot;, property=&quot;password&quot;, label=&quot;Password&quot;)#
&nbsp;
<span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #990000; font-weight: bold;">cfoutput</span><span style="color: #0000FF;">&gt;</span></span></pre></div></div>

<p>This is a lot simpler than what I had morphed the view template into in my <a href="http://www.clearcrystalmedia.com/pm/same-view-multiple-actions-coldfusion-on-wheels/">original refactoring</a>. There were way too many parameters, abstractions, and pieces of logic to unpack each time I revisited the template. Yuck!</p>
<p>So now I can change the template at <kbd>views/users/edit.cfm</kbd> to also include the partial and proudly display the other elements that make it unique in its own separate template (which includes a different <code>&lt;h1&gt;</code>, form action, button label, and the need to also provide a hidden field for <code>id</code>):</p>

<div class="wp_syntax"><div class="code"><pre class="cfm" style="font-family:monospace;"><span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cfparam</span> <span style="color: #0000FF;">name</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;user&quot;</span><span style="color: #0000FF;">&gt;</span></span>
&nbsp;
<span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cfoutput</span><span style="color: #0000FF;">&gt;</span></span>
&nbsp;
<span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #000000; font-weight: bold;">h1</span><span style="color: #0000FF;">&gt;</span></span>Edit User<span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #000000; font-weight: bold;">h1</span><span style="color: #0000FF;">&gt;</span></span>
&nbsp;
<span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cfif</span> flashKeyExists<span style="color: #0000FF;">&#40;</span><span style="color: #009900;">&quot;success&quot;</span><span style="color: #0000FF;">&#41;</span><span style="color: #0000FF;">&gt;</span></span>
    <span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #000000; font-weight: bold;">p</span> <span style="color: #0000FF;">class</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;success&quot;</span><span style="color: #0000FF;">&gt;</span></span>#flash(&quot;success&quot;)#<span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #000000; font-weight: bold;">p</span><span style="color: #0000FF;">&gt;</span></span>
<span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #990000; font-weight: bold;">cfif</span><span style="color: #0000FF;">&gt;</span></span>
&nbsp;
#startFormTag(action=&quot;update&quot;)#
&nbsp;
<span style="color: #0000FF;">#includePartial<span style="color: #0000FF;">&#40;</span>user<span style="color: #0000FF;">&#41;</span>#</span>
<span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #000000; font-weight: bold;">div</span><span style="color: #0000FF;">&gt;</span></span>
    #hiddenField(objectName=&quot;user&quot;, property=&quot;id&quot;)#
    <span style="color: #0000FF;">#submitTag<span style="color: #0000FF;">&#40;</span><span style="color: #0000FF;">&#41;</span>#</span>
<span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #000000; font-weight: bold;">div</span><span style="color: #0000FF;">&gt;</span></span>
&nbsp;
<span style="color: #0000FF;">#endFormTag<span style="color: #0000FF;">&#40;</span><span style="color: #0000FF;">&#41;</span>#</span>
&nbsp;
<span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #990000; font-weight: bold;">cfoutput</span><span style="color: #0000FF;">&gt;</span></span></pre></div></div>

<p>What does the controller code look like then? Well, now it&#8217;s back to the simplicity from the original tutorial:</p>

<div class="wp_syntax"><div class="code"><pre class="cfm" style="font-family:monospace;"><span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cffunction</span> <span style="color: #0000FF;">name</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;add&quot;</span><span style="color: #0000FF;">&gt;</span></span>
    <span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cfset</span> user <span style="color: #0000FF;">=</span> model<span style="color: #0000FF;">&#40;</span><span style="color: #009900;">&quot;user&quot;</span><span style="color: #0000FF;">&#41;</span>.new<span style="color: #0000FF;">&#40;</span><span style="color: #0000FF;">&#41;</span><span style="color: #0000FF;">&gt;</span></span>
<span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #990000; font-weight: bold;">cffunction</span><span style="color: #0000FF;">&gt;</span></span>
&nbsp;
<span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cffunction</span> <span style="color: #0000FF;">name</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;edit&quot;</span><span style="color: #0000FF;">&gt;</span></span>
    <span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cfset</span> user <span style="color: #0000FF;">=</span> model<span style="color: #0000FF;">&#40;</span><span style="color: #009900;">&quot;user&quot;</span><span style="color: #0000FF;">&#41;</span>.findByKey<span style="color: #0000FF;">&#40;</span>params.key<span style="color: #0000FF;">&#41;</span><span style="color: #0000FF;">&gt;</span></span>
<span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #990000; font-weight: bold;">cffunction</span><span style="color: #0000FF;">&gt;</span></span></pre></div></div>

<p>Hooray for simplicity!</p>
<h2>Experience is the best teacher</h2>
<p>Sometimes you don&#8217;t really know how to handle some of these scenarios until you&#8217;ve played around with them a little. My <a href="http://www.clearcrystalmedia.com/pm/same-view-multiple-actions-coldfusion-on-wheels/">first approach</a> (the one I&#8217;m criticizing in this tutorial) is certainly a valid one and may make sense in certain scenarios, perhaps outside the context of forms.</p>
<p>I encourage you to try different approaches and share them with others so we can keep an open discussion about best practices. It takes a little humility to openly admit that I went down the wrong path earlier, but I hope that you will find some value in this discussion.</p>

<!-- start wp-tags-to-technorati 1.01 -->

<!-- end wp-tags-to-technorati -->
<img src="http://feeds.feedburner.com/~r/polymorphism/~4/Hfeq7ChBbds" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.clearcrystalmedia.com/pm/including-partials-dry-forms-cfwheels/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		<feedburner:origLink>http://www.clearcrystalmedia.com/pm/including-partials-dry-forms-cfwheels/</feedburner:origLink></item>
		<item>
		<title>Pop up PDFs in a new window with jQuery</title>
		<link>http://feeds.clearcrystalmedia.com/~r/polymorphism/~3/HEZkMT7qE0Y/</link>
		<comments>http://www.clearcrystalmedia.com/pm/pop-up-pdfs-new-window-jquery/#comments</comments>
		<pubDate>Thu, 05 Aug 2010 21:41:57 +0000</pubDate>
		<dc:creator>Chris Peters</dc:creator>
				<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://www.clearcrystalmedia.com/pm/?p=502</guid>
		<description><![CDATA[<p>I was looking for a good way to pop up all <abbr title="Portable Document Format">PDF</abbr> links in a new window and ran across <a href="http://blog.codesignstudios.com/using-jquery-to-make-all-pdf-links-open-in-a-new-window/" title="Using JQuery to make all <abbr title="Portable Document Format">PDF</abbr> links open in a new window">Dennison Uy's post with code</a>.</p>
<p>But I did modify his code slightly. Read on for what I did and why.</p>]]></description>
			<content:encoded><![CDATA[<p>I was looking for a good way to pop up all <abbr title="Portable Document Format">PDF</abbr> links in a new window and ran across <a href="http://blog.codesignstudios.com/using-jquery-to-make-all-pdf-links-open-in-a-new-window/" title="Using JQuery to make all PDF links open in a new window">Dennison Uy&#8217;s post with code</a>.</p>
<p>Pretty slick and very unobtrusive, and it keeps <code>target="_blank"</code> out of your markup, which is arguably a behavioral and not structural thing anyway. Plus it&#8217;s one step closer to <a href="http://www.clearcrystalmedia.com/pm/target-equals-blank-must-die/" title="Target equals blank must die!">killing <code>target="_blank"</code></a>.</p>
<h2>My slight modification: being a tad more user friendly</h2>
<p>Here&#8217;s my version of the code:</p>

<div class="wp_syntax"><div class="code"><pre class="js" style="font-family:monospace;">$(&quot;a[href*=.pdf]&quot;).click(function(){
	window.open(this.href, &quot;&quot;, &quot;toolbar=0&quot;);
	return false;
});</pre></div></div>

<p>I basically took what he did and added <code>toolbar=0</code> to the arguments for <code>window.open()</code>.</p>
<p>Why? Jakob Nielsen&#8217;s <a href="http://www.useit.com/alertbox/open_new_windows.html" title="Open New Windows for PDF and other Non-Web Documents">guidelines for opening <abbr title="Portable Document Format">PDF</abbr>s in a new window</a> call for removing browser chrome like the Back button. Why? Browser navigation doesn&#8217;t fit the paradigm for <abbr title="Portable Document Format">PDF</abbr> document navigation. And Neilsen has watched thousands of users fumble around with the Web, while the rest of us have not.</p>

<!-- start wp-tags-to-technorati 1.01 -->

<!-- end wp-tags-to-technorati -->
<img src="http://feeds.feedburner.com/~r/polymorphism/~4/HEZkMT7qE0Y" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.clearcrystalmedia.com/pm/pop-up-pdfs-new-window-jquery/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.clearcrystalmedia.com/pm/pop-up-pdfs-new-window-jquery/</feedburner:origLink></item>
		<item>
		<title>Experimenting with flashMessages() in ColdFusion on Wheels</title>
		<link>http://feeds.clearcrystalmedia.com/~r/polymorphism/~3/DkWr5RzzOxk/</link>
		<comments>http://www.clearcrystalmedia.com/pm/experimenting-flashmessages-cfwheels/#comments</comments>
		<pubDate>Wed, 04 Aug 2010 11:55:13 +0000</pubDate>
		<dc:creator>Chris Peters</dc:creator>
				<category><![CDATA[ColdFusion on Wheels]]></category>

		<guid isPermaLink="false">http://www.clearcrystalmedia.com/pm/?p=496</guid>
		<description><![CDATA[<p>On my Labs site, I've written <a href="http://labs.clearcrystalmedia.com/cfwheels/flashmessages" title="flashMessages() in ColdFusion on Wheels">another page</a> exploring a view helper coming up in ColdFusion on Wheels version 1.1 called <code>flashMessages()</code>. Read on about it if you want more details, but here's the gist.</p>]]></description>
			<content:encoded><![CDATA[<p>On my Labs site, I&#8217;ve written <a href="http://labs.clearcrystalmedia.com/cfwheels/flashmessages" title="flashMessages() in ColdFusion on Wheels">another page</a> exploring a view helper coming up in ColdFusion on Wheels version 1.1 called <code>flashMessages()</code>. Read on about it if you want more details, but here&#8217;s the gist.</p>
<p>In my layouts, I can reduce this logic:</p>

<div class="wp_syntax"><div class="code"><pre class="cfm" style="font-family:monospace;"><span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cfoutput</span><span style="color: #0000FF;">&gt;</span></span>
&nbsp;
<span style="color: #808080; font-style: italic;">&lt;!--- Display error message from the Flash ---&gt;</span>
<span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cfif</span> flashKeyExists<span style="color: #0000FF;">&#40;</span><span style="color: #009900;">&quot;error&quot;</span><span style="color: #0000FF;">&#41;</span><span style="color: #0000FF;">&gt;</span></span>
	<span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #000000; font-weight: bold;">div</span> <span style="color: #0000FF;">class</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;error-message&quot;</span><span style="color: #0000FF;">&gt;</span></span>
		#flash(&quot;error&quot;)#
	<span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #000000; font-weight: bold;">div</span><span style="color: #0000FF;">&gt;</span></span>
<span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #990000; font-weight: bold;">cfif</span><span style="color: #0000FF;">&gt;</span></span>
&nbsp;
<span style="color: #808080; font-style: italic;">&lt;!--- Display success message from the Flash ---&gt;</span>
<span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cfif</span> flashKeyExists<span style="color: #0000FF;">&#40;</span><span style="color: #009900;">&quot;success&quot;</span><span style="color: #0000FF;">&#41;</span><span style="color: #0000FF;">&gt;</span></span>
	<span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #000000; font-weight: bold;">div</span> <span style="color: #0000FF;">class</span><span style="color: #0000FF;">=</span><span style="color: #009900;">&quot;success-message&quot;</span><span style="color: #0000FF;">&gt;</span></span>
		#flash(&quot;success&quot;)#
	<span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #000000; font-weight: bold;">div</span><span style="color: #0000FF;">&gt;</span></span>
<span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #990000; font-weight: bold;">cfif</span><span style="color: #0000FF;">&gt;</span></span>
&nbsp;
<span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #990000; font-weight: bold;">cfoutput</span><span style="color: #0000FF;">&gt;</span></span></pre></div></div>

<p>To this line of code:</p>

<div class="wp_syntax"><div class="code"><pre class="cfm" style="font-family:monospace;"><span style="color: #333333;"><span style="color: #0000FF;">&lt;</span><span style="color: #990000; font-weight: bold;">cfoutput</span><span style="color: #0000FF;">&gt;</span></span>
	<span style="color: #0000FF;">#flashMessages<span style="color: #0000FF;">&#40;</span><span style="color: #0000FF;">&#41;</span>#</span>
<span style="color: #333333;"><span style="color: #0000FF;">&lt;/</span><span style="color: #990000; font-weight: bold;">cfoutput</span><span style="color: #0000FF;">&gt;</span></span></pre></div></div>

<p>This takes care of 80% of your potential usage of <a title="Using the Flash" href="http://cfwheels.org/docs/chapter/using-the-flash">the Flash</a> in Wheels, and it reduces the logic to a single function call. Win!</p>

<!-- start wp-tags-to-technorati 1.01 -->

<!-- end wp-tags-to-technorati -->
<img src="http://feeds.feedburner.com/~r/polymorphism/~4/DkWr5RzzOxk" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.clearcrystalmedia.com/pm/experimenting-flashmessages-cfwheels/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.clearcrystalmedia.com/pm/experimenting-flashmessages-cfwheels/</feedburner:origLink></item>
		<item>
		<title>Playing around with automatic validations in Wheels 1.1</title>
		<link>http://feeds.clearcrystalmedia.com/~r/polymorphism/~3/8f3ubyIoc-0/</link>
		<comments>http://www.clearcrystalmedia.com/pm/automatic-validations-wheels-1-1/#comments</comments>
		<pubDate>Wed, 21 Jul 2010 12:02:26 +0000</pubDate>
		<dc:creator>Chris Peters</dc:creator>
				<category><![CDATA[ColdFusion on Wheels]]></category>

		<guid isPermaLink="false">http://www.clearcrystalmedia.com/pm/?p=491</guid>
		<description><![CDATA[<p>A cool new feature coming up in ColdFusion on Wheels 1.1 is <em>automatic validations</em>. I <a href="http://labs.clearcrystalmedia.com/cfwheels/automatic-validations">wrote a page</a> last night to play around with the new feature a little and figure out how it all works.</p>]]></description>
			<content:encoded><![CDATA[<p>A cool new feature coming up in ColdFusion on Wheels 1.1 is <em>automatic validations</em>. I <a href="http://labs.clearcrystalmedia.com/cfwheels/automatic-validations">wrote a page</a> last night to play around with the new feature a little and figure out how it all works.</p>
<p>In a nutshell, automatic validations remove the need for you to call simple validation functions like <code>validatesPresenceOf()</code>, <code>validatesLengthOf()</code>, and <code>validatesNumericalityOf()</code> in your models. Wheels will introspect your database fields for signals like <code>NOT NULL</code>, data types, and maximum lengths. When you call <code>save()</code>, <code>create()</code>, or <code>update()</code>, Wheels will run the validations for you based on this information (unless you specify otherwise).</p>
<p>If the database is already storing this information about your data, why not leverage it without writing any more code? Very clever stuff.</p>
<p>Here are the beginnings of <a href="http://labs.clearcrystalmedia.com/cfwheels/automatic-validations">my experimentation with the new feature</a>. Feel free to follow along and see what&#8217;s coming up in the next version. There will be more.</p>

<!-- start wp-tags-to-technorati 1.01 -->

<!-- end wp-tags-to-technorati -->
<img src="http://feeds.feedburner.com/~r/polymorphism/~4/8f3ubyIoc-0" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.clearcrystalmedia.com/pm/automatic-validations-wheels-1-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.clearcrystalmedia.com/pm/automatic-validations-wheels-1-1/</feedburner:origLink></item>
		<item>
		<title>Bug fixes in ColdFISH on Wheels version 0.3</title>
		<link>http://feeds.clearcrystalmedia.com/~r/polymorphism/~3/dhxNQZsX2qA/</link>
		<comments>http://www.clearcrystalmedia.com/pm/bug-fixes-coldfish-on-wheels-version-0-3/#comments</comments>
		<pubDate>Thu, 01 Jul 2010 01:36:46 +0000</pubDate>
		<dc:creator>Chris Peters</dc:creator>
				<category><![CDATA[ColdFusion]]></category>
		<category><![CDATA[ColdFusion on Wheels]]></category>
		<category><![CDATA[cfwheels]]></category>
		<category><![CDATA[coldfish]]></category>
		<category><![CDATA[coldfish on wheels]]></category>
		<category><![CDATA[coldfusion on wheels]]></category>
		<category><![CDATA[dave shuck]]></category>
		<category><![CDATA[expandpath]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[plugins]]></category>

		<guid isPermaLink="false">http://www.clearcrystalmedia.com/pm/?p=486</guid>
		<description><![CDATA[<p>I went to deploy my new <a href="http://cfwheels.org/plugins/listing/40">ColdFISH on Wheels plugin</a> on my Linux server and got a curious error. Especially if you're using Linux, you'll want to upgrade to ColdFISH on Wheels 0.3 <abbr title="as soon as possible">ASAP</abbr>.</p>
<p>What happened? Read on to find out.</p>]]></description>
			<content:encoded><![CDATA[<p>I went to deploy my new <a href="http://cfwheels.org/plugins/listing/40">ColdFISH on Wheels plugin</a> on my Linux server and got a curious error. Especially if you&#8217;re using Linux, you&#8217;ll want to upgrade to ColdFISH on Wheels 0.3 <abbr title="as soon as possible">ASAP</abbr>.</p>
<p>So what was the error? It involved <a href="http://help.adobe.com/en_US/ColdFusion/9.0/CFMLRef/WSc3ff6d0ea77859461172e0811cbec22c24-7c67.html"><code>ExpandPath()</code></a>. Fortunately, <a title="Strange behavior with ColdFusion ExpandPath() when using Symbolic Links" href="http://daveshuck.instantspot.com/blog/2009/09/23/Strange-behavior-with-ColdFusion-ExpandPath-when-using-Symbolic-Links">Dave Shuck&#8217;s blog saved the day for me</a>. Evidently <code>"/config/coldfishconfig.xml"</code> means something different on Linux than <code>"./config/coldfishconfig.xml"</code>. It was really strange what the first string translated to on my server. It was some weird path involving <code>"shared://"</code>.</p>
<p>Go figure.</p>
<p>How the hell did any of us ever get by before Google got really good and  everyone blogged about their solutions to problems?</p>

<!-- start wp-tags-to-technorati 1.01 -->

<p class='technorati-tags'>Technorati Tags: <a class='technorati-link' href='http://technorati.com/tag/cfwheels' rel='tag' target='_self'>cfwheels</a>, <a class='technorati-link' href='http://technorati.com/tag/coldfish' rel='tag' target='_self'>coldfish</a>, <a class='technorati-link' href='http://technorati.com/tag/coldfish+on+wheels' rel='tag' target='_self'>coldfish on wheels</a>, <a class='technorati-link' href='http://technorati.com/tag/ColdFusion' rel='tag' target='_self'>ColdFusion</a>, <a class='technorati-link' href='http://technorati.com/tag/coldfusion+on+wheels' rel='tag' target='_self'>coldfusion on wheels</a>, <a class='technorati-link' href='http://technorati.com/tag/dave+shuck' rel='tag' target='_self'>dave shuck</a>, <a class='technorati-link' href='http://technorati.com/tag/expandpath' rel='tag' target='_self'>expandpath</a>, <a class='technorati-link' href='http://technorati.com/tag/linux' rel='tag' target='_self'>linux</a>, <a class='technorati-link' href='http://technorati.com/tag/plugin' rel='tag' target='_self'>plugin</a>, <a class='technorati-link' href='http://technorati.com/tag/plugins' rel='tag' target='_self'>plugins</a></p>

<!-- end wp-tags-to-technorati -->
<img src="http://feeds.feedburner.com/~r/polymorphism/~4/dhxNQZsX2qA" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.clearcrystalmedia.com/pm/bug-fixes-coldfish-on-wheels-version-0-3/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://www.clearcrystalmedia.com/pm/bug-fixes-coldfish-on-wheels-version-0-3/</feedburner:origLink></item>
	</channel>
</rss>
