<?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>Storm Blog &#187; Development</title>
	<atom:link href="http://www.storm-consultancy.com/development/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.storm-consultancy.com</link>
	<description>Web Design News &#38; Tutorials</description>
	<lastBuildDate>Thu, 09 Feb 2012 09:25:38 +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>Where to find Rails&#8217; default validation error messages</title>
		<link>http://www.storm-consultancy.com/development/random-bits/where-to-find-rails-default-validation-error-messages/</link>
		<comments>http://www.storm-consultancy.com/development/random-bits/where-to-find-rails-default-validation-error-messages/#comments</comments>
		<pubDate>Thu, 09 Feb 2012 09:25:38 +0000</pubDate>
		<dc:creator>Adam Pope</dc:creator>
				<category><![CDATA[Random Bits]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://www.storm-consultancy.com/?p=1227</guid>
		<description><![CDATA[I&#8217;ve been playing around with simple_form and I18n in Rails a LOT in a recent project.  I&#8217;ve been customising form labels and validation messages using the internationalisation features &#8211; it works really, really well.  There is, however, one small problem.  When you start, you are presented with an almost blank YAML file and some very [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been playing around with <a href="https://github.com/plataformatec/simple_form">simple_form</a> and <a href="http://guides.rubyonrails.org/i18n.html">I18n</a> in Rails a LOT in a recent project.  I&#8217;ve been customising form labels and validation messages using the internationalisation features &#8211; it works really, really well.  There is, however, one small problem.  When you start, you are presented with an almost blank YAML file and some very flakey documentation at the bottom of the simple_form readme.  How do you know how to structure that YAML file?  What attribute names should you use?</p>
<p>One of the best resources I&#8217;ve found so far are the defaults files in the Rails source code.</p>
<p><a href="https://github.com/rails/rails/blob/master/activemodel/lib/active_model/locale/en.yml">https://github.com/rails/rails/blob/master/activemodel/lib/active_model/locale/en.yml<br />
</a><a href="https://github.com/rails/rails/blob/master/activerecord/lib/active_record/locale/en.yml">https://github.com/rails/rails/blob/master/activerecord/lib/active_record/locale/en.yml</a></p>
<p>That gives you a full list of the attribute names to use for different validators.  For example, if you&#8217;re using a <em>validates_format_of</em> validator, you can quickly see that you need to use the <em>invalid</em> YAML attribute.  Good luck guessing that one!</p>
<p>The looking at the source trick can also be very useful for gems.  I&#8217;ve spent ages Googling for the correct YAML attribute to use for the validates_email_format_of gem with absolutely no luck whatsoever.  30 seconds on Github and I find the <a href="https://github.com/alexdunae/validates_email_format_of/blob/master/lib/validates_email_format_of.rb">source file</a> which tells me the attribute for an invalid email address is <em>invalid_email_address</em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.storm-consultancy.com/development/random-bits/where-to-find-rails-default-validation-error-messages/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using HAML with Rails 3.2</title>
		<link>http://www.storm-consultancy.com/development/using-haml-with-rails-3-2/</link>
		<comments>http://www.storm-consultancy.com/development/using-haml-with-rails-3-2/#comments</comments>
		<pubDate>Wed, 08 Feb 2012 17:42:12 +0000</pubDate>
		<dc:creator>Paul Leader</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Tools & Plugins]]></category>

		<guid isPermaLink="false">http://www.storm-consultancy.com/?p=1223</guid>
		<description><![CDATA[I&#8217;m currently working on a small internal project, so I&#8217;m taking the opportunity to try out HAML and see if I like it. After some digging around I found various docs that suggested that you need to add the haml gem and include something like the following in application.rb config.generators do &#124;g&#124; g.template_engine :haml end [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m currently working on a small internal project, so I&#8217;m taking the opportunity to try out HAML and see if I like it.</p>
<p>After some digging around I found various docs that suggested that you need to add the <strong><code>haml</code></strong> gem and include something like the following in application.rb</p>
<pre class="brush:ruby">config.generators do |g|
  g.template_engine :haml
end</pre>
<p>However, after a couple of attempts to generate HAML templates for a scaffold controller there was clearly something not quite right.  I kept getting the following error:</p>
<pre>error  haml [not found]</pre>
<p>It turns out that the <code>haml</code> gem doesn&#8217;t give you generators for Rails 3.</p>
<p>After a bit more digging I found the <code>haml-rails</code> gem.  Add that to your <code>Gemfile</code> and it adds generators for HAML, and enables it, so you can get rid of that declaration in  <code>application.rb</code></p>
<p>So now I&#8217;m all HAML&#8217;d up and ready to go. I like it so far, but we&#8217;ll see how I feel in a week or two of working with it.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.storm-consultancy.com/development/using-haml-with-rails-3-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How To: Nicely format compressed and minified JavaScript in Chrome</title>
		<link>http://www.storm-consultancy.com/development/tips-tricks/how-to-nicely-format-compressed-and-minified-javascript-in-chrome/</link>
		<comments>http://www.storm-consultancy.com/development/tips-tricks/how-to-nicely-format-compressed-and-minified-javascript-in-chrome/#comments</comments>
		<pubDate>Thu, 26 Jan 2012 09:55:20 +0000</pubDate>
		<dc:creator>Adam Pope</dc:creator>
				<category><![CDATA[Tips & Tricks]]></category>
		<category><![CDATA[chrome]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://www.storm-consultancy.com/?p=1200</guid>
		<description><![CDATA[I&#8217;ve just found a button that is full of complete win in Chrome.  For years I&#8217;ve struggled to debug problems in jQuery plugins and other people&#8217;s scripts that are served in compressed, minified form.  Not any more! Before The Magical Pretty Print Button After &#160;]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve just found a button that is full of complete win in Chrome.  For years I&#8217;ve struggled to debug problems in jQuery plugins and other people&#8217;s scripts that are served in compressed, minified form.  Not any more!</p>
<p><span id="more-1200"></span></p>
<h3>Before</h3>
<p><a href="http://www.storm-consultancy.com/wp-content/uploads/2012/01/Screen-shot-2012-01-26-at-09.33.44.png"><img class="aligncenter size-medium wp-image-1201" title="Compressed and Minified jQuery" src="http://www.storm-consultancy.com/wp-content/uploads/2012/01/Screen-shot-2012-01-26-at-09.33.44-258x300.png" alt="Compressed and Minified jQuery" width="258" height="300" /></a></p>
<h3>The Magical Pretty Print Button</h3>
<p><a href="http://www.storm-consultancy.com/wp-content/uploads/2012/01/Screen-shot-2012-01-26-at-09.34.431.png"><img class="aligncenter size-full wp-image-1203" title="Pretty Print" src="http://www.storm-consultancy.com/wp-content/uploads/2012/01/Screen-shot-2012-01-26-at-09.34.431.png" alt="Pretty Print" width="486" height="180" /></a></p>
<h3>After</h3>
<p><a href="http://www.storm-consultancy.com/wp-content/uploads/2012/01/Screen-shot-2012-01-26-at-09.34.14.png"><img class="aligncenter size-medium wp-image-1202" title="Uncompressed and readable jQuery" src="http://www.storm-consultancy.com/wp-content/uploads/2012/01/Screen-shot-2012-01-26-at-09.34.14-258x300.png" alt="Uncompressed and readable jQuery" width="258" height="300" /></a></p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.storm-consultancy.com/development/tips-tricks/how-to-nicely-format-compressed-and-minified-javascript-in-chrome/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using the Top Conversion Paths Report: Defining Custom Channel Groupings</title>
		<link>http://www.storm-consultancy.com/development/tutorials/using-the-top-conversion-paths-report-defining-custom-channel-groupings/</link>
		<comments>http://www.storm-consultancy.com/development/tutorials/using-the-top-conversion-paths-report-defining-custom-channel-groupings/#comments</comments>
		<pubDate>Fri, 13 Jan 2012 12:52:59 +0000</pubDate>
		<dc:creator>Scott</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Misc Web Stuff]]></category>
		<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://www.storm-consultancy.com/?p=1131</guid>
		<description><![CDATA[&#160; The top conversion paths report is an awesome bit of kit; one of the five new multi-channel funnel reports in Google Analytics. The report shows a graphical table of the most common channels a user passes through to complete a site goal. The basic channel grouping is as follows: Channel Description 1.Paid Advertising Visits [...]]]></description>
			<content:encoded><![CDATA[<p>&nbsp;</p>
<p>The top conversion paths report is an awesome bit of kit; one of the five new <a href="http://www.storm-consultancy.com/blog/development/tutorials/understanding-multi-channel-funnels-an-introduction/">multi-channel funnel reports</a> in Google Analytics. The report shows a graphical table of the most common channels a user passes through to complete a site goal. The basic channel grouping is as follows:</p>
<table width="600" cellpadding="5px">
<tbody>
<tr>
<td><strong>Channel</strong></td>
<td><strong>Description</strong></td>
</tr>
<tr>
<td>1.Paid Advertising</td>
<td>Visits from AdWords and/or links tagged with a medium of &#8220;cpc&#8221;, &#8220;ppc&#8221;, &#8220;cpm&#8221;, &#8220;cpv&#8221;, &#8220;cpa&#8221;, &#8220;cpp&#8221;.</td>
</tr>
<tr>
<td>2.Organic Search</td>
<td>Visits from unpaid search on any search engine (i.e. medium=&#8221;organic&#8221;).</td>
</tr>
<tr>
<td>3.Social Network</td>
<td>Visits from any of about 150 social networks.</td>
</tr>
<tr>
<td>4.Referral</td>
<td>Visits from websites that are not social networks.</td>
</tr>
<tr>
<td>5.Email</td>
<td>Visits that are tagged with a medium of &#8220;email&#8221;.</td>
</tr>
<tr>
<td>6.Feed</td>
<td>Visits that are tagged with a medium of &#8220;feed&#8221;.</td>
</tr>
<tr>
<td>7.Direct</td>
<td>Visits in which the visitor typed the name of your website URL into the browser or who came to your site via a bookmark.</td>
</tr>
</tbody>
</table>
<p>Note that the channel listing follows an ordering process, in that visits which are not tagged as belonging to the first channel (Paid Advertising) fall through to the rule for the second channel, and so on. In the basic channel grouping, the direct channel also includes visits from a source/medium of &#8220;not set,&#8221; so that 100% of the site traffic is defined by this set of rules.</p>
<p>A classic example of how a visitor would interact with your site via different channels would be someone coming across your site via a Google search, bookmarking it, and then returning later via the bookmark to complete your goal:</p>
<p><a href="http://www.storm-consultancy.com/wp-content/uploads/2012/01/Searchdirect.jpg"><img class="aligncenter size-full wp-image-1155" title="Searchdirect" src="http://www.storm-consultancy.com/wp-content/uploads/2012/01/Searchdirect.jpg" alt="Search, direct path" width="589" height="119" /></a></p>
<p>This is great, and with a table full of information like this, there is plenty of information to extract. However, the real power of the report comes in defining your own channel groupings. For example, in the above we see that the user originally came across the site by an organic search. We could create two channels to replace this one, breaking it down further into searches that already knew of your brand, and searches that came across your site with no prior knowledge of it (filtering by keyword.)</p>
<p>In order to set up your own channels, a simple way to do so is to edit the basic grouping. An easy way to copy the basic grouping template is found in the channel groupings drop down above the data set:</p>
<p>&nbsp;</p>
<p><a href="http://www.storm-consultancy.com/wp-content/uploads/2012/01/channelgroup.jpg"><img class="aligncenter size-full wp-image-1161" title="channelgroup" src="http://www.storm-consultancy.com/wp-content/uploads/2012/01/channelgroup.jpg" alt="" width="738" height="270" /></a></p>
<p>&nbsp;</p>
<p><a href="http://www.storm-consultancy.com/wp-content/uploads/2012/01/channeledit.jpg"><img class="alignright  wp-image-1164" title="channeledit" src="http://www.storm-consultancy.com/wp-content/uploads/2012/01/channeledit.jpg" alt="" width="320" height="240" /></a></p>
<p>To move the channel ordering, drag on the grey boxes on the left of the buttons. Highlight the right hand side of a button to edit:</p>
<p>The interface is the same as in the search filter and advanced segments, so to create another rule highlight the &#8220;add &#8216;AND&#8217; statement,&#8221; and select the dimension of keyword as below. Enter your brand name, and relabel the channel title before saving. Your groupings will also then be able to be used in the assisted conversions report.</p>
<p>&nbsp;</p>
<p><a href="http://www.storm-consultancy.com/wp-content/uploads/2012/01/stormsearch.jpg"><img class="aligncenter size-large wp-image-1167" title="stormsearch" src="http://www.storm-consultancy.com/wp-content/uploads/2012/01/stormsearch-1024x433.jpg" alt="" width="640" height="270" /></a></p>
<p>&nbsp;</p>
<p>From here, you can edit and create more channels to suit your needs. Track campaigns, visits through your blog, visits from your twitter account, visits from retweets, visits from apps and much more; giving you the vital information on how all these channels interact.</p>
<p>Although this report is hidden away deep in the goals section of the standard reports in Google Analytics, the information gleaned from it is priceless for any site owner.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.storm-consultancy.com/development/tutorials/using-the-top-conversion-paths-report-defining-custom-channel-groupings/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Understanding Multi-Channel Funnels: An Introduction</title>
		<link>http://www.storm-consultancy.com/development/tutorials/understanding-multi-channel-funnels-an-introduction/</link>
		<comments>http://www.storm-consultancy.com/development/tutorials/understanding-multi-channel-funnels-an-introduction/#comments</comments>
		<pubDate>Fri, 13 Jan 2012 12:52:22 +0000</pubDate>
		<dc:creator>Scott</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Misc Web Stuff]]></category>
		<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://www.storm-consultancy.com/?p=1116</guid>
		<description><![CDATA[Over the last year we have received a barrage of great updates from the chaps over at Google Analytics, with everything from an interface redesign to real-time monitoring of site traffic. However my favourite of these recent announcements has been the inclusion of five powerful new reports under the label of multi-channel funnels. These new reports [...]]]></description>
			<content:encoded><![CDATA[<p>Over the last year we have received a barrage of great updates from the chaps over at Google Analytics, with everything from an <a href="http://analytics.blogspot.com/2011/09/design-updates-to-new-interface-coming.html">interface redesign</a> to <a href="http://analytics.blogspot.com/2011/09/whats-happening-on-your-site-right-now.html">real-time monitoring</a> of site traffic.</p>
<p>However my favourite of these recent announcements has been the inclusion of five powerful new reports under the label of <a href="http://analytics.blogspot.com/2011/08/introducing-multi-channel-funnels.html">multi-channel funnels</a>. These new reports are sure to be highly useful tools for advertisers and business owners alike by allowing a more detailed analysis of how they are attracting the most important traffic to their sites.</p>
<p>The reports are found under the Conversions section of the Standard reports, and so in order to be useful, a site must have some Goals enabled. Note that goals do not have to be e-commerce related, but are an essential part of tracking and reaching the targets of any site. For example, if you run a small business and want to know who the people are that click on your contact page, you can set that up as a goal, and then analyse who accomplishes it – who converts.</p>
<p><a href="http://www.storm-consultancy.com/wp-content/uploads/2012/01/conversion-path.jpg"><img class="aligncenter size-full wp-image-1117" title="conversion path" src="http://www.storm-consultancy.com/wp-content/uploads/2012/01/conversion-path.jpg" alt="" width="459" height="158" /></a><br />
An <strong>interaction</strong> with a site is defined by the visit received from a specific channel.  A <strong>channel</strong> can combine many different dimensions such as source, medium, keyword, campaign etc. The standard channels that the reports use are the following (for more info see <a href="http://www.storm-consultancy.com/blog/development/tutorials/using-the-top-conversion-paths-report-defining-custom-channel-groupings/">here</a>:)</p>
<p><a href="http://www.storm-consultancy.com/wp-content/uploads/2012/01/basicchannels.jpg"><img class="aligncenter size-full wp-image-1119" title="basicchannels" src="http://www.storm-consultancy.com/wp-content/uploads/2012/01/basicchannels.jpg" alt="" width="694" height="191" /></a><br />
Previously when trying to establish a picture of how effective specific marketing efforts were, Google Analytics would provide information of only the last interaction that led to a conversion. These new reports are extremely valuable as they can show us channels of visits to a site that a user makes within the 30 days before a conversion (provided cookies have not been cleared.)This is important, as a large number of visitors will browse around before eventually deciding to make a conversion.<br />
<a href="http://www.storm-consultancy.com/wp-content/uploads/2012/01/visual.jpg"><img class="alignright  wp-image-1120 niceborder" title="Overview Report Venn" src="http://www.storm-consultancy.com/wp-content/uploads/2012/01/visual.jpg" alt="Overview Report Venn" width="270" height="330" /></a>Under the “Multi-Channel Funnels” heading, we are provided with five reports:</p>
<p><strong>Overview Report</strong> &#8211; Provides a standard graph of goal conversions over time, allowing you to choose and compare between the conversions and assisted conversions metrics. Also includes a visualizer that produces a Venn diagram of conversions and assists between up to 4 selected channels:</p>
<p><strong>Assisted Conversions Report – </strong>Allows you to compare the assisted conversions and final interaction conversions metrics. Also includes a ratio of the two, helping the user to analyse which channels spread knowledge of the site, and which lead to directly to conversions.</p>
<p><strong>Top Conversion Paths Report – </strong>Shows in picture form, the paths that users took to convert. Also gives statistics on the numbers of people who took the specific path. For more info see <a href="http://www.storm-consultancy.com/blog/development/tutorials/using-the-top-conversion-paths-report-defining-custom-channel-groupings/">here</a>.</p>
<p><strong>Time Lag </strong>– Give us information on how long users took to complete their path to conversion. Produces this in the form as below:</p>
<p><a href="http://www.storm-consultancy.com/wp-content/uploads/2012/01/timelag.jpg"><img class="wp-image-1122 niceborder alignleft" title="Time Lag Report" src="http://www.storm-consultancy.com/wp-content/uploads/2012/01/timelag.jpg" alt="Time Lag Report" width="700" height="200" /></a><br />
<strong>Path Length – </strong>Report produces a similar looking set of data to the Time Lag report, but instead of “Time Lag in Days,” shows us “Path length.”</p>
<p>Put together these reports give us valuable new insight into how a sites most important visitors access its most valuable content. For more information on the power of the top conversion paths report and on custom channel groupings, see our blog post <a href="http://www.storm-consultancy.com/blog/development/tutorials/using-the-top-conversion-paths-report-defining-custom-channel-groupings/">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.storm-consultancy.com/development/tutorials/understanding-multi-channel-funnels-an-introduction/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Upgrading a Rails 3.0 project to Rails 3.1</title>
		<link>http://www.storm-consultancy.com/development/tutorials/upgrading-a-rails-3-0-project-to-rails-3-1/</link>
		<comments>http://www.storm-consultancy.com/development/tutorials/upgrading-a-rails-3-0-project-to-rails-3-1/#comments</comments>
		<pubDate>Fri, 13 Jan 2012 10:47:16 +0000</pubDate>
		<dc:creator>Adam Pope</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://www.storm-consultancy.com/?p=1108</guid>
		<description><![CDATA[I&#8217;ve just upgraded an old Ruby on Rails 3.0 project to the current 3.1 build.  Having expected ours of pain I was very pleased to discover that it&#8217;s all terribly easy.  Here&#8217;s the step by step (as ever YMMV depending on gems you have installed). Open your gemfile and replace gem &#8216;rails&#8217;, &#8217;3.0.0&#8242; with  gem &#8216;rails&#8217;, [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve just upgraded an old Ruby on Rails 3.0 project to the current 3.1 build.  Having expected ours of pain I was very pleased to discover that it&#8217;s all terribly easy.  Here&#8217;s the step by step (as ever YMMV depending on gems you have installed).</p>
<p><span id="more-1108"></span></p>
<ol>
<li>Open your gemfile and replace<strong> gem &#8216;rails&#8217;, &#8217;3.0.0&#8242;</strong> with  <strong>gem &#8216;rails&#8217;, &#8217;3.1.3&#8242;</strong>.  3.1.3 being the latest build at the time of writing.</li>
<li>If you want to use the new asset pipeline hotness in 3.1 (and why wouldn&#8217;t you?) you need to add a new section at the bottom of the file:
<pre class="brush:ruby">group :assets do
  gem 'sass-rails', "  ~&gt; 3.1.0"
  gem 'coffee-rails', "~&gt; 3.1.0"
  gem 'uglifier'
end</pre>
</li>
<li>Now open up your command line and run a <strong>bundle install</strong>. You may need to delete gemfile.lock.</li>
<li>The next step is to run rake rails:update.  The first time I did this I got the error &#8220;uninitialized constant ActionView::Helpers::JavaScriptProxy&#8221;.  To resolve this I removed <strong>jrails</strong> from my gemfile as Rails 3.1 uses jQuery anyway.  I then re-ran the rake command.</li>
<li>The Rails update will generate a bunch of conflicts.  I did the following (make sure you use the diff option to check for yourself!):
<ul>
<li>boot.rb &#8211; overwrite.</li>
<li>routes.rb &#8211; do not overwrite.</li>
<li>application.rb &#8211; do not overwrite. We&#8217;ll patch this up manually next.</li>
<li>development.rb &#8211; do not overwrite. You might be able to get away with overwriting this, but I have settings I need in here.</li>
<li>production.rb &#8211; do no overwrite. Again, I have settings I need in here.</li>
<li>test.rb &#8211; overwrite. I didn&#8217;t have any special settings here, but use the diff to check yours!</li>
<li>secret_token.rb &#8211; overwrite.</li>
<li>session_store.rb &#8211; overwrite.</li>
<li>en.yml &#8211; do not overwrite.</li>
</ul>
</li>
<li>Now we need to make a few changes that would have been made if we let Rails overwrite our files. Open up config/application.rb and add the following:
<pre class="brush:ruby"># Enable the asset pipeline
config.assets.enabled = true

# Version of your assets, change this if you want to expire all your assets
config.assets.version = '1.0'</pre>
</li>
<li>Open up config/environments/development.rb, remove &#8220;config.action_view.debug_rjs = true&#8221;and add the following:
<pre class="brush:ruby"># Do not compress assets
config.assets.compress = false

# Expands the lines which load the assets
config.assets.debug = true</pre>
</li>
<li>Open up config/environments/production.rb and add:
<pre class="brush:ruby"># Compress JavaScripts and CSS
config.assets.compress = true

# Don't fallback to assets pipeline if a precompiled asset is missed
config.assets.compile = false

# Generate digests for assets URLs
config.assets.digest = true</pre>
</li>
<li>Create a new <strong>assets</strong> folder in <strong>app</strong> and then add <strong>images</strong>, <strong>javascripts</strong> and <strong>stylesheets</strong> and sub-directories.  Move your CSS, JS and image files into these directories.</li>
<li>You&#8217;ll have to do some work to cleanup your assets and how they are included in your layouts &#8211; but that&#8217;s very much an exercise for the reader :)</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://www.storm-consultancy.com/development/tutorials/upgrading-a-rails-3-0-project-to-rails-3-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Today&#8217;s Gotcha: Localhost is not included in the &#8216;%&#8217; wildcard when granting MySQL permissions</title>
		<link>http://www.storm-consultancy.com/development/todays-gotcha-localhost-is-not-included-in-the-wildcard-when-granting-mysql-permissions/</link>
		<comments>http://www.storm-consultancy.com/development/todays-gotcha-localhost-is-not-included-in-the-wildcard-when-granting-mysql-permissions/#comments</comments>
		<pubDate>Fri, 13 Jan 2012 09:51:14 +0000</pubDate>
		<dc:creator>Paul Leader</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Gotchas]]></category>
		<category><![CDATA[Tips & Tricks]]></category>

		<guid isPermaLink="false">http://www.storm-consultancy.com/?p=1112</guid>
		<description><![CDATA[MySQL administration is one of those things I have to do pretty infrequently, so when I do there&#8217;s always something that trips me up and wastes a bit of time. This week it was granting permissions on a database. To grant permissions on a database to a user you use something like&#8230; GRANT ALL ON [...]]]></description>
			<content:encoded><![CDATA[<p>MySQL administration is one of those things I have to do pretty infrequently, so when I do there&#8217;s always something that trips me up and wastes a bit of time.</p>
<p>This week it was granting permissions on a database.</p>
<p>To grant permissions on a database to a user you use something like&#8230;</p>
<pre class="brush:sql">GRANT ALL ON db1.* TO 'user'@'hostname';</pre>
<p><code>Hostname </code>can also be &#8216;%&#8217;, which is a wildcard for any host.</p>
<p>My gotcha was that &#8216;%&#8217; does not include &#8216;localhost&#8217;, so the locally hosted application couldn&#8217;t access the database that I could connect to remotely.</p>
<p>It&#8217;s not immediately obvious in the documentation that this is the case.  It says that &#8216;%&#8217; &#8220; applies to <em><code>user_name</code></em> for any host in the <code>192.168.1</code> class C subnet&#8221;, which of course in hind-sight does not include &#8216;localhost&#8217;.  While the local machine is in that class-C in most networks, the connection will come via the loopback address, not through an external network, so it&#8217;s origin host will not be in the &#8216;%&#8217; set.</p>
<p>It can seem slightly counter intuitive but it makes sense when you understand a little more about what&#8217;s happening.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.storm-consultancy.com/development/todays-gotcha-localhost-is-not-included-in-the-wildcard-when-granting-mysql-permissions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CoffeeScript, SASS and LESS compilation in Visual Studio 2010</title>
		<link>http://www.storm-consultancy.com/development/tools-plugins/coffeescript-sass-and-less-compilation-in-visual-studio-2010/</link>
		<comments>http://www.storm-consultancy.com/development/tools-plugins/coffeescript-sass-and-less-compilation-in-visual-studio-2010/#comments</comments>
		<pubDate>Thu, 12 Jan 2012 10:00:32 +0000</pubDate>
		<dc:creator>Adam Pope</dc:creator>
				<category><![CDATA[Tools & Plugins]]></category>
		<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[coffeescript]]></category>
		<category><![CDATA[LESS]]></category>
		<category><![CDATA[Plugins]]></category>
		<category><![CDATA[SASS]]></category>
		<category><![CDATA[SCSS]]></category>
		<category><![CDATA[Visual Studio]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://www.storm-consultancy.com/?p=1053</guid>
		<description><![CDATA[I&#8217;ve been doing most of my development in Ruby on Rails over the past month and have fallen in love with the Asset Pipeline.  This is a process that lets you write in the new, more expressive forms and then compile and serve the raw CSS and JavaScript to the user. The enhancements to CSS that are [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been doing most of my development in Ruby on Rails over the past month and have fallen in love with the <a href="http://guides.rubyonrails.org/asset_pipeline.html">Asset Pipeline</a>.  This is a process that lets you write in the new, more expressive forms and then compile and serve the raw CSS and JavaScript to the user.</p>
<p>The enhancements to CSS that are found in <a href="http://sass-lang.com/">SASS</a> and <a href="http://lesscss.org/">LESS</a> are simply brilliant and save a massive amount of time.  Variables, nested selectors and mixins are just a few of my personal favourites.  <a href="http://coffeescript.org/">CoffeeScript</a> puts a wonderfully expressive veneer on top of JavaScript, removing lots of the grunt work and making your code much cleaner.</p>
<p>Using these improvements to the everyday languages has become second-nature and I&#8217;d be reluctant to go back.  Think about how much of a difference jQuery made to JavaScript DOM manipulation and animaton &#8211; you just wouldn&#8217;t want to go back to how it used to be!</p>
<p>However, my time is split between the Ruby on Rails world and the ASP.NET MVC world.  .NET doesn&#8217;t have native support for these new languages yet.  What&#8217;s a dev to do?</p>
<p><span id="more-1053"></span></p>
<p>Thankfully, the lovely people of Mindscape have released a <a href="http://visualstudiogallery.msdn.microsoft.com/2b96d16a-c986-4501-8f97-8008f9db141a">free Visual Studio plugin</a> to take our pain away! The plugin handles CoffeeScript, LESS and SASS files, compiling them to native code every time you save your file.</p>
<p><a href="http://www.storm-consultancy.com/wp-content/uploads/2011/12/Screen-shot-2011-12-30-at-16.13.47.png"><img class="aligncenter size-full wp-image-1055" style="border-style: initial; border-color: initial;" title="New files created on save" src="http://www.storm-consultancy.com/wp-content/uploads/2011/12/Screen-shot-2011-12-30-at-16.13.47.png" alt="New files created on save" width="233" height="74" /></a></p>
<p>It also adds new project items types to the &#8216;Add Item&#8217; dialog and provides syntax highlighting within .coffee, .less and .sass files.</p>
<p><a href="http://www.storm-consultancy.com/wp-content/uploads/2011/12/Screen-shot-2011-12-30-at-16.11.39.png"><img class="aligncenter size-full wp-image-1054" title="New files types" src="http://www.storm-consultancy.com/wp-content/uploads/2011/12/Screen-shot-2011-12-30-at-16.11.39.png" alt="File types in Add Item" width="292" height="135" /></a></p>
<p>&nbsp;</p>
<p>Simple and brilliant.  You can still link to your CSS and JavaScript files as you always have in HTML, or, as I do, use a NuGet package like <a href="http://nuget.org/packages/combres">Combres</a> to combine and minify your files to reduce page load time.</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.storm-consultancy.com/development/tools-plugins/coffeescript-sass-and-less-compilation-in-visual-studio-2010/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Today&#8217;s gotcha: CoffeeScript templates in Rails work in development but not production by default</title>
		<link>http://www.storm-consultancy.com/development/random-bits/todays-gotcha-when-coffeescript-templates-in-rails-work-in-development-but-not-production/</link>
		<comments>http://www.storm-consultancy.com/development/random-bits/todays-gotcha-when-coffeescript-templates-in-rails-work-in-development-but-not-production/#comments</comments>
		<pubDate>Wed, 11 Jan 2012 11:00:55 +0000</pubDate>
		<dc:creator>Paul Leader</dc:creator>
				<category><![CDATA[Bug of the Day]]></category>
		<category><![CDATA[Random Bits]]></category>

		<guid isPermaLink="false">http://www.storm-consultancy.com/?p=1092</guid>
		<description><![CDATA[Deployment is always a bit of a pain. No matter how hard you try there will almost always be a subtle difference between your dev and production environments (which is why ideally you should have a deployment test environment). I had an odd bug today when deploying a Rails app.  I have an AJAX call, [...]]]></description>
			<content:encoded><![CDATA[<p>Deployment is always a bit of a pain. No matter how hard you try there will almost always be a subtle difference between your dev and production environments (which is why ideally you should have a deployment test environment).</p>
<p>I had an odd bug today when deploying a Rails app.  I have an AJAX call, that returns a javascript block.  The template is actually a CoffeeScript file with the name check.js.coffee, the idea being that the CoffeeScript gets compiled to JavaScript before being sent out.</p>
<p>This works absolutely fine in development mode on my Mac.</p>
<p>Deploy it to the server and I get</p>
<pre class="brush:ruby">
ActionView::MissingTemplate (Missing template projects/check, application/check with {:handlers=&gt;[:erb, :builder], :formats=&gt;[:js, "application/ecmascript", "application/x-ecmascript", :html, :text, :js, :css, :ics, :csv, :xml, :rss, :atom, :yaml, :multipart_form, :url_encoded_form, :json, :obj], :locale=&gt;[:en, :en]}. Searched in:
* "/home/.users/70/revedadmin/online_editor/app/views"
* "/usr/local/lib/ruby/gems/1.9.1/gems/devise-1.5.0/app/views"
* "/usr/local/lib/ruby/gems/1.9.1/gems/kaminari-0.12.4/app/views"
):
</pre>
<p>The application is looking for check.js.erb or something similar.  It doesn&#8217;t know what to do with the CoffeeScript file.</p>
<p>It turns out that Rails won&#8217;t compile CoffeeScript templates by default, but you can install the <a title="Coffeebean gem github page" href="https://github.com/markbates/coffeebeans">Coffeebean</a> gem and it magically works. It also has view helpers which let you drop CoffeeScript into an erb template like this&#8230;</p>
<pre class="brush:rails">&lt;%= coffee_script_tag do %&gt;
  alert 'coffee script is awesome!'
&lt;% end %&gt;</pre>
<p>which is neat.</p>
<p>But the real gotcha is that this works out of the box in development mode, so you assume that it will work in development.</p>
<p>When in development mode, the asset compilation pipeline is appears to be compiling the CoffeeScript template at runtime. But with compilation turned off in production mode this no longer happens.</p>
<p>I assume this is not an intended behaviour as it rather breaks the idea of Rails apps working the same largely irrespective of the platform.  I will do some more digging.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.storm-consultancy.com/development/random-bits/todays-gotcha-when-coffeescript-templates-in-rails-work-in-development-but-not-production/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Error: &#8220;No parameterless constructor defined for this object&#8221; when using Dependency Injection</title>
		<link>http://www.storm-consultancy.com/development/tips-tricks/error-no-parameterless-constructor-defined-for-this-object-when-using-dependency-injection/</link>
		<comments>http://www.storm-consultancy.com/development/tips-tricks/error-no-parameterless-constructor-defined-for-this-object-when-using-dependency-injection/#comments</comments>
		<pubDate>Tue, 10 Jan 2012 13:37:25 +0000</pubDate>
		<dc:creator>Adam Pope</dc:creator>
				<category><![CDATA[Tips & Tricks]]></category>
		<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Dependency Injection]]></category>
		<category><![CDATA[Errors]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.storm-consultancy.com/?p=1103</guid>
		<description><![CDATA[There are several reasons you might see the error &#8220;No parameterless constructor defined for this object&#8221; but I often see it in conjunction with Dependency Injection.  My setup is .NET MVC with Ninject, but I imagine this is applicable to many other combinations.  I use constructor injection to pass services and repositories to my controllers. [...]]]></description>
			<content:encoded><![CDATA[<p>There are several reasons you might see the error &#8220;No parameterless constructor defined for this object&#8221; but I often see it in conjunction with Dependency Injection.  My setup is .NET MVC with Ninject, but I imagine this is applicable to many other combinations.  I use constructor injection to pass services and repositories to my controllers.</p>
<p>The error is triggered when you request an instance of a service you have not wired up properly in your DI config.  It&#8217;s a classic case of the error message not actually telling you what the real problem is.  For example, I just added the new dependency on IDirectDebitProvider to my BillingController:</p>
<pre class="brush:csharp">public BillingController(IOrganisationRepository org, IDirectDebitProvider dd)
{
    // implementation
}</pre>
<p>However, I had not added the following line to my Ninject configuration:</p>
<pre class="brush:csharp">kernel.Bind&lt;IDirectDebitProvider&gt;().To&lt;SmartDebit&gt;();</pre>
<p>For more, read our getting started guide for <a href="http://www.storm-consultancy.com/blog/development/tutorials/a-really-simple-guide-to-getting-started-with-dependency-injection-in-asp-net-mvc-3/">DI with ASP.NET MVC</a>.</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.storm-consultancy.com/development/tips-tricks/error-no-parameterless-constructor-defined-for-this-object-when-using-dependency-injection/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

