<?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/"
	xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Mr. Matt - Ruby on Rails Developer, Manchester UK</title>
	<atom:link href="http://matthall.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://matthall.wordpress.com</link>
	<description></description>
	<lastBuildDate>Sat, 22 Aug 2009 12:07:29 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<cloud domain='matthall.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://www.gravatar.com/blavatar/9b2ab93b36caf547406441c21e7457cb?s=96&#038;d=http://s.wordpress.com/i/buttonw-com.png</url>
		<title>Mr. Matt - Ruby on Rails Developer, Manchester UK</title>
		<link>http://matthall.wordpress.com</link>
	</image>
			<item>
		<title>Checking for a WiFi Connection in One Line</title>
		<link>http://matthall.wordpress.com/2009/08/22/checking-for-a-wifi-connection-in-one-line/</link>
		<comments>http://matthall.wordpress.com/2009/08/22/checking-for-a-wifi-connection-in-one-line/#comments</comments>
		<pubDate>Sat, 22 Aug 2009 12:07:29 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[Random Gubbins]]></category>
		<category><![CDATA[dev]]></category>
		<category><![CDATA[iphone]]></category>

		<guid isPermaLink="false">http://matthall.wordpress.com/?p=65</guid>
		<description><![CDATA[So if you have an app that requires a WiFi network connection in order to reliably synchronize some large-ish data set, you need to notify your user if the connection is not available. 
Apple provides the Reachability example app that demonstrates how to do this, and you can use the Reachablility class in that app [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=matthall.wordpress.com&blog=17453&post=65&subd=matthall&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>So if you have an app that requires a WiFi network connection in order to reliably synchronize some large-ish data set, you need to notify your user if the connection is not available. </p>
<p>Apple provides the <a href="http://developer.apple.com/iphone/library/samplecode/Reachability/index.html">Reachability example app</a> that demonstrates how to do this, and you can use the Reachablility class in that app in your own app.</p>
<p>1. Add the Reachability.h and Reachability.m files to your project.<br />
2. Include Reachablility.h in the header of the file you&#8217;re going to do the check<br />
3. Add the following line:</p>
<pre class="brush: cpp;">
[[Reachability reachabilityForLocalWiFi] currentReachabilityStatus] == ReachableViaWiFi
</pre>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/matthall.wordpress.com/65/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/matthall.wordpress.com/65/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/matthall.wordpress.com/65/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/matthall.wordpress.com/65/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/matthall.wordpress.com/65/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/matthall.wordpress.com/65/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/matthall.wordpress.com/65/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/matthall.wordpress.com/65/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/matthall.wordpress.com/65/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/matthall.wordpress.com/65/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=matthall.wordpress.com&blog=17453&post=65&subd=matthall&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://matthall.wordpress.com/2009/08/22/checking-for-a-wifi-connection-in-one-line/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/f6925b0d9a374a15f8ba30a11b14f323?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">matthall</media:title>
		</media:content>
	</item>
		<item>
		<title>Easy Linking with Polymorphic Associations in Rails</title>
		<link>http://matthall.wordpress.com/2009/07/24/easy-linking-with-polymorphic-associations-in-rails/</link>
		<comments>http://matthall.wordpress.com/2009/07/24/easy-linking-with-polymorphic-associations-in-rails/#comments</comments>
		<pubDate>Fri, 24 Jul 2009 15:55:56 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[Random Gubbins]]></category>

		<guid isPermaLink="false">http://matthall.wordpress.com/?p=59</guid>
		<description><![CDATA[Just a quick tip, this one!
If you have a model that is polymorphic, say a comment model:

class Comment
  belongs_to :user
  belongs_to :commentable, :polymorphic =&#62; true
end

and you want to link to the item the comment relates to in the admin system, you can do this:

&#60;%= link_to comment.commentable.title, [:admin, comment.commentable] %&#62;

Note this assumes all of [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=matthall.wordpress.com&blog=17453&post=59&subd=matthall&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Just a quick tip, this one!</p>
<p>If you have a model that is polymorphic, say a comment model:</p>
<pre class="brush: ruby;">
class Comment
  belongs_to :user
  belongs_to :commentable, :polymorphic =&gt; true
end
</pre>
<p>and you want to link to the item the comment relates to in the admin system, you can do this:</p>
<pre class="brush: ruby;">
&lt;%= link_to comment.commentable.title, [:admin, comment.commentable] %&gt;
</pre>
<p>Note this assumes all of your commentable models have a title attribute or method, and that you have used normal RESTful routes. The :admin symbol will namespace the link to /admin</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/matthall.wordpress.com/59/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/matthall.wordpress.com/59/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/matthall.wordpress.com/59/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/matthall.wordpress.com/59/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/matthall.wordpress.com/59/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/matthall.wordpress.com/59/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/matthall.wordpress.com/59/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/matthall.wordpress.com/59/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/matthall.wordpress.com/59/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/matthall.wordpress.com/59/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=matthall.wordpress.com&blog=17453&post=59&subd=matthall&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://matthall.wordpress.com/2009/07/24/easy-linking-with-polymorphic-associations-in-rails/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/f6925b0d9a374a15f8ba30a11b14f323?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">matthall</media:title>
		</media:content>
	</item>
		<item>
		<title>Bort updated to Rails 2.2</title>
		<link>http://matthall.wordpress.com/2008/11/10/bort-updated-to-rails-22/</link>
		<comments>http://matthall.wordpress.com/2008/11/10/bort-updated-to-rails-22/#comments</comments>
		<pubDate>Mon, 10 Nov 2008 10:25:10 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[Random Gubbins]]></category>

		<guid isPermaLink="false">http://matthall.wordpress.com/?p=50</guid>
		<description><![CDATA[If you don&#8217;t already know, Bort has now been updated to Rails 2.2. For more information on exactly what has changed, please see Jim&#8217;s post.
I have also updated my email-as-login fork of bort to include this release.
Please give us your feedback over on our Uservoice page.
       <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=matthall.wordpress.com&blog=17453&post=50&subd=matthall&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>If you don&#8217;t already know, Bort has now been updated to Rails 2.2. For more information on exactly what has changed, <a href="http://jimneath.org/2008/11/06/bort-update-to-rails-22/">please see Jim&#8217;s post</a>.</p>
<p>I have also updated my <a href="http://github.com/MattHall/bort/tree/master">email-as-login fork of bort</a> to include this release.</p>
<p>Please give us your feedback over on <a href="http://bort.uservoice.com/">our Uservoice page</a>.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/matthall.wordpress.com/50/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/matthall.wordpress.com/50/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/matthall.wordpress.com/50/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/matthall.wordpress.com/50/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/matthall.wordpress.com/50/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/matthall.wordpress.com/50/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/matthall.wordpress.com/50/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/matthall.wordpress.com/50/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/matthall.wordpress.com/50/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/matthall.wordpress.com/50/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=matthall.wordpress.com&blog=17453&post=50&subd=matthall&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://matthall.wordpress.com/2008/11/10/bort-updated-to-rails-22/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/f6925b0d9a374a15f8ba30a11b14f323?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">matthall</media:title>
		</media:content>
	</item>
		<item>
		<title>A Helper for Testing Access Control with RSpec</title>
		<link>http://matthall.wordpress.com/2008/10/14/a-helper-for-testing-access-control-with-rspec/</link>
		<comments>http://matthall.wordpress.com/2008/10/14/a-helper-for-testing-access-control-with-rspec/#comments</comments>
		<pubDate>Tue, 14 Oct 2008 10:13:08 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[Random Gubbins]]></category>

		<guid isPermaLink="false">http://matthall.wordpress.com/?p=44</guid>
		<description><![CDATA[When testing Controller actions for access restriction, I was building a set of tests for each controller that were in a similar format to this:

describe &#34;access control&#34; do
  it &#34;should prevent access by non-logged-in users&#34;
  it &#34;should prevent access by normal users&#34;
  it &#34;should prevent access by editor users&#34;
  it &#34;should [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=matthall.wordpress.com&blog=17453&post=44&subd=matthall&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>When testing Controller actions for access restriction, I was building a set of tests for each controller that were in a similar format to this:</p>
<pre class="brush: ruby;">
describe &quot;access control&quot; do
  it &quot;should prevent access by non-logged-in users&quot;
  it &quot;should prevent access by normal users&quot;
  it &quot;should prevent access by editor users&quot;
  it &quot;should prevent access by admin users&quot;
  it &quot;should allow access by super admin users&quot;
end
</pre>
<p>Unforunately, this was neither dry, complete, nor very readable, so I have come up with the following helper that allows you to specify the access restrictions for a number of methods:</p>
<p>In your spec_helper.rb file, add the following function:</p>
<pre class="brush: ruby;">
def access_control (code, options={})
  options = {:allow =&gt; [], :disallow =&gt; []}.merge(options)

  options[:allow].each do |user|
    it &quot;#{code} should allow #{user.to_s}&quot; do
      login_as(user)
      eval code
      response.should_not redirect_to(login_path)
    end
  end

  options[:disallow].each do |user|
    it &quot;#{code} should disallow #{user.to_s}&quot; do
      login_as(user)
      eval code
      response.should redirect_to(login_path)
    end
  end
end
</pre>
<p>Then in the specs for your controller, call the function as follows:</p>
<pre class="brush: ruby;">
access_control(&quot;get :index&quot;, {:allow =&gt; [:super_admin], :disallow =&gt; [:quentin, :admin]})
</pre>
<p>This allows you to very quickly build a set of specs that fully describe how access control to your methods should restrict your users:</p>
<pre class="brush: ruby;">
[ &quot;get :show, :id =&gt; 0&quot;,
      &quot;get :new&quot;,
      &quot;post :create, :setting_value =&gt; {:value =&gt; 'A new setting', :group =&gt; 0}&quot;,
      &quot;get :edit&quot;,
      &quot;put :update, :id =&gt; SettingValue.first.id, :setting_value =&gt; {:value =&gt; 'changed'}&quot;,
      &quot;delete :destroy, :id =&gt; SettingValue.first.id&quot;
    ].each do |action|
      access_control(action, {:allow =&gt; [:super_admin], :disallow =&gt; [:quentin, :admin]})
</pre>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/matthall.wordpress.com/44/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/matthall.wordpress.com/44/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/matthall.wordpress.com/44/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/matthall.wordpress.com/44/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/matthall.wordpress.com/44/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/matthall.wordpress.com/44/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/matthall.wordpress.com/44/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/matthall.wordpress.com/44/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/matthall.wordpress.com/44/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/matthall.wordpress.com/44/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=matthall.wordpress.com&blog=17453&post=44&subd=matthall&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://matthall.wordpress.com/2008/10/14/a-helper-for-testing-access-control-with-rspec/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/f6925b0d9a374a15f8ba30a11b14f323?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">matthall</media:title>
		</media:content>
	</item>
		<item>
		<title>A Bort Fork &#8211; Rails Base Application</title>
		<link>http://matthall.wordpress.com/2008/09/09/a-bort-fork-rails-base-application/</link>
		<comments>http://matthall.wordpress.com/2008/09/09/a-bort-fork-rails-base-application/#comments</comments>
		<pubDate>Tue, 09 Sep 2008 14:59:14 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[Bort]]></category>

		<guid isPermaLink="false">http://matthall.wordpress.com/?p=39</guid>
		<description><![CDATA[In order to DRY-up our process of creating new rails projects over at Fudge, we recently created Bort &#8211; a base rails application that contains all of the bits that we push together when starting out.
Jim has more about the base system, but there is also a fork that contains all of the bort goodness, [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=matthall.wordpress.com&blog=17453&post=39&subd=matthall&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>In order to DRY-up our process of creating new rails projects over at <a href="http://fudgestudios.com">Fudge</a>, we recently created <a href="https://github.com/fudgestudios/bort/tree">Bort</a> &#8211; a base rails application that contains all of the bits that we push together when starting out.</p>
<p><a href="http://jimneath.org/2008/09/09/bort-base-rails-application">Jim has more about the base system</a>, but there is also <a href="https://github.com/MattHall/bort/tree">a fork</a> that contains all of the bort goodness, with the notable difference that instead of using usernames to authenticate, the users email address is used instead.</p>
<p><a href="https://github.com/MattHall/bort/tree">Enjoy.</a></p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/matthall.wordpress.com/39/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/matthall.wordpress.com/39/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/matthall.wordpress.com/39/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/matthall.wordpress.com/39/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/matthall.wordpress.com/39/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/matthall.wordpress.com/39/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/matthall.wordpress.com/39/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/matthall.wordpress.com/39/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/matthall.wordpress.com/39/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/matthall.wordpress.com/39/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/matthall.wordpress.com/39/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/matthall.wordpress.com/39/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=matthall.wordpress.com&blog=17453&post=39&subd=matthall&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://matthall.wordpress.com/2008/09/09/a-bort-fork-rails-base-application/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/f6925b0d9a374a15f8ba30a11b14f323?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">matthall</media:title>
		</media:content>
	</item>
		<item>
		<title>Unterminated String Literal with Asset Packager</title>
		<link>http://matthall.wordpress.com/2008/05/20/unterminated-string-literal-with-asset-packager/</link>
		<comments>http://matthall.wordpress.com/2008/05/20/unterminated-string-literal-with-asset-packager/#comments</comments>
		<pubDate>Tue, 20 May 2008 14:31:09 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[Random Gubbins]]></category>

		<guid isPermaLink="false">http://matthall.wordpress.com/?p=37</guid>
		<description><![CDATA[A recent release of Bouldr threw a bit of a spanner in the works when the excellent Asset Packager began choking when attempting to create our concatenated and compressed javascript file.
It turns out that as I am developing in Windows (gah!), I need to run dos2unix in order to ensure that the js files are [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=matthall.wordpress.com&blog=17453&post=37&subd=matthall&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>A recent release of Bouldr threw a bit of a spanner in the works when the excellent Asset Packager began choking when attempting to create our concatenated and compressed javascript file.</p>
<p>It turns out that as I am developing in Windows (gah!), I need to run dos2unix in order to ensure that the js files are in the appropriate file format (our server is running CentOS). In order to automate this process, I added the following to our deploy script:</p>
<pre class="brush: ruby;">
# Need to ensure files are in UNIX format for the asset packager to run correctly
run &quot;cd #{release_path}/public/javascripts &amp;&amp; find . -name '*.js' -exec dos2unix '{}' \\;&quot;

# Run the asset packager to create the production javascript and css files
run &quot;cd #{release_path} &amp;&amp; rake asset:packager:build_all RAILS_ENV=production&quot;
</pre>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/matthall.wordpress.com/37/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/matthall.wordpress.com/37/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/matthall.wordpress.com/37/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/matthall.wordpress.com/37/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/matthall.wordpress.com/37/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/matthall.wordpress.com/37/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/matthall.wordpress.com/37/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/matthall.wordpress.com/37/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/matthall.wordpress.com/37/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/matthall.wordpress.com/37/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/matthall.wordpress.com/37/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/matthall.wordpress.com/37/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=matthall.wordpress.com&blog=17453&post=37&subd=matthall&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://matthall.wordpress.com/2008/05/20/unterminated-string-literal-with-asset-packager/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/f6925b0d9a374a15f8ba30a11b14f323?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">matthall</media:title>
		</media:content>
	</item>
		<item>
		<title>Really Simple History (RSH) Initial URL</title>
		<link>http://matthall.wordpress.com/2008/04/07/really-simple-history-rsh-initial-url/</link>
		<comments>http://matthall.wordpress.com/2008/04/07/really-simple-history-rsh-initial-url/#comments</comments>
		<pubDate>Mon, 07 Apr 2008 17:48:57 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[Bouldr]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[really simple history]]></category>
		<category><![CDATA[rsh]]></category>

		<guid isPermaLink="false">http://matthall.wordpress.com/?p=36</guid>
		<description><![CDATA[I recently came across a small problem in RSH whereby on loading a page with a state in the url (e.g. localhost.com/test_page#test) would not trigger the history listener function on it&#8217;s initial load. To fix this, I needed to modify my window onload function to include a call to my history listener, as follows:

history_listener: function [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=matthall.wordpress.com&blog=17453&post=36&subd=matthall&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>I recently came across a small problem in RSH whereby on loading a page with a state in the url (e.g. localhost.com/test_page#test) would not trigger the history listener function on it&#8217;s initial load. To fix this, I needed to modify my window onload function to include a call to my history listener, as follows:</p>
<pre class="brush: jscript;">
history_listener: function (newLocation, historyData) {
...
},

// Window.onload calls this
initialize_history: function () {
       	dhtmlHistory.initialize();
       	dhtmlHistory.addListener(this.history_listener.bindAsEventListener(this));

       	// Added this line to force a call to my history listener
       	this.history_listener(dhtmlHistory.getCurrentLocation());
}
</pre>
<p>This ensures that when the page is freshly loaded, the history listener is called with the contents of our initial location.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/matthall.wordpress.com/36/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/matthall.wordpress.com/36/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/matthall.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/matthall.wordpress.com/36/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/matthall.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/matthall.wordpress.com/36/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/matthall.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/matthall.wordpress.com/36/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/matthall.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/matthall.wordpress.com/36/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/matthall.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/matthall.wordpress.com/36/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=matthall.wordpress.com&blog=17453&post=36&subd=matthall&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://matthall.wordpress.com/2008/04/07/really-simple-history-rsh-initial-url/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/f6925b0d9a374a15f8ba30a11b14f323?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">matthall</media:title>
		</media:content>
	</item>
		<item>
		<title>Installing MySQL Gem &#8211; CentOS</title>
		<link>http://matthall.wordpress.com/2008/01/24/installing-mysql-gem-centos/</link>
		<comments>http://matthall.wordpress.com/2008/01/24/installing-mysql-gem-centos/#comments</comments>
		<pubDate>Thu, 24 Jan 2008 02:40:56 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[Random Gubbins]]></category>

		<guid isPermaLink="false">http://matthall.wordpress.com/2008/01/24/installing-mysql-gem-centos/</guid>
		<description><![CDATA[This one had me for a while: When attempting to install the MySQL gem on my shiny new Slicehost slice, I was getting the folowing error:

Building native extensions.  This could take a while...
ERROR:  Error installing mysql:
   ERROR: Failed to build gem native extension.

/usr/local/bin/ruby extconf.rb install mysql -- --with-mysql-include=/usr/include/mysql --with-mysql-lib=/usr/lib/mysql
checking for mysql_query() [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=matthall.wordpress.com&blog=17453&post=35&subd=matthall&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>This one had me for a while: When attempting to install the MySQL gem on my shiny new Slicehost slice, I was getting the folowing error:</p>
<pre class="brush: xml;">
Building native extensions.  This could take a while...
ERROR:  Error installing mysql:
   ERROR: Failed to build gem native extension.

/usr/local/bin/ruby extconf.rb install mysql -- --with-mysql-include=/usr/include/mysql --with-mysql-lib=/usr/lib/mysql
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lm... yes
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lz... yes
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lsocket... no
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lnsl... yes
checking for mysql_query() in -lmysqlclient... no
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers.  Check the mkmf.log file for more
details.  You may need configuration options.

Provided configuration options:
   --with-opt-dir
   --without-opt-dir
   --with-opt-include
   --without-opt-include=${opt-dir}/include
   --with-opt-lib
   --without-opt-lib=${opt-dir}/lib
   --with-make-prog
   --without-make-prog
   --srcdir=.
   --curdir
   --ruby=/usr/local/bin/ruby
   --with-mysql-config
   --without-mysql-config
   --with-mysql-dir
   --without-mysql-dir
   --with-mysql-include=${mysql-dir}/include
   --with-mysql-lib=${mysql-dir}/lib
   --with-mysqlclientlib
   --without-mysqlclientlib
   --with-mlib
   --without-mlib
   --with-mysqlclientlib
   --without-mysqlclientlib
   --with-zlib
   --without-zlib
   --with-mysqlclientlib
   --without-mysqlclientlib
   --with-socketlib
   --without-socketlib
   --with-mysqlclientlib
   --without-mysqlclientlib
   --with-nsllib
   --without-nsllib
   --with-mysqlclientlib
   --without-mysqlclientlib

Gem files will remain installed in /usr/local/lib/ruby/gems/1.8/gems/mysql-2.7 for inspection.
Results logged to /usr/local/lib/ruby/gems/1.8/gems/mysql-2.7/gem_make.out
</pre>
<p>It turns out, all I needed was to run the following:</p>
<pre class="brush: xml;">
gem install mysql -- --with-mysql-config=/usr/bin/mysql_config
</pre>
<p>Hope this saves someone the hour or so I spent scratching my head!</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/matthall.wordpress.com/35/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/matthall.wordpress.com/35/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/matthall.wordpress.com/35/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/matthall.wordpress.com/35/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/matthall.wordpress.com/35/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/matthall.wordpress.com/35/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/matthall.wordpress.com/35/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/matthall.wordpress.com/35/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/matthall.wordpress.com/35/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/matthall.wordpress.com/35/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/matthall.wordpress.com/35/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/matthall.wordpress.com/35/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=matthall.wordpress.com&blog=17453&post=35&subd=matthall&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://matthall.wordpress.com/2008/01/24/installing-mysql-gem-centos/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/f6925b0d9a374a15f8ba30a11b14f323?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">matthall</media:title>
		</media:content>
	</item>
		<item>
		<title>Stopping a submit_tag from Sending it&#8217;s Value</title>
		<link>http://matthall.wordpress.com/2007/12/12/stopping-a-submit_tag-from-sending-its-value/</link>
		<comments>http://matthall.wordpress.com/2007/12/12/stopping-a-submit_tag-from-sending-its-value/#comments</comments>
		<pubDate>Wed, 12 Dec 2007 03:12:17 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Rails]]></category>

		<guid isPermaLink="false">http://matthall.wordpress.com/2007/12/12/stopping-a-submit_tag-from-sending-its-value/</guid>
		<description><![CDATA[OK, so say you have a form as follows:

&#60;% form_tag '/', :method =&#62; :get do -%&#62;
&#60;p&#62;&#60;%= text_field_tag 'q', params[:q] &#124;&#124;= '' %&#62; &#60;%= submit_tag 'Search' %&#62;&#60;/p&#62;
&#60;% end %&#62;

That form will send the contents of the text box to the page at &#8216;/&#8217;. Unfortunately, it will also send through the value of the submit button, which [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=matthall.wordpress.com&blog=17453&post=34&subd=matthall&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>OK, so say you have a form as follows:</p>
<pre class="brush: xml;">
&lt;% form_tag '/', :method =&gt; :get do -%&gt;
&lt;p&gt;&lt;%= text_field_tag 'q', params[:q] ||= '' %&gt; &lt;%= submit_tag 'Search' %&gt;&lt;/p&gt;
&lt;% end %&gt;
</pre>
<p>That form will send the contents of the text box to the page at &#8216;/&#8217;. Unfortunately, it will also send through the value of the submit button, which is &#8216;Search&#8217; in this case. The url generated will be:</p>
<p>/?q=something&amp;commit=Search</p>
<p>In this case, we would want only the &#8216;q&#8217; parameter passing through, and in order to do this, all we need do is nullify the name parameter:</p>
<pre class="brush: xml;">
&lt;% form_tag '/', :method =&gt; :get do -%&gt;
&lt;p&gt;&lt;%= text_field_tag 'q', params[:q] ||= '' %&gt; &lt;%= submit_tag 'Search', :name =&gt; nil %&gt;&lt;/p&gt;
&lt;% end %&gt;
</pre>
<p>This will create the following url on submission:</p>
<p>/?q=something</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/matthall.wordpress.com/34/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/matthall.wordpress.com/34/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/matthall.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/matthall.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/matthall.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/matthall.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/matthall.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/matthall.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/matthall.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/matthall.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/matthall.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/matthall.wordpress.com/34/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=matthall.wordpress.com&blog=17453&post=34&subd=matthall&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://matthall.wordpress.com/2007/12/12/stopping-a-submit_tag-from-sending-its-value/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/f6925b0d9a374a15f8ba30a11b14f323?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">matthall</media:title>
		</media:content>
	</item>
		<item>
		<title>Gem Documentation Server</title>
		<link>http://matthall.wordpress.com/2007/12/06/gem-documentation-server/</link>
		<comments>http://matthall.wordpress.com/2007/12/06/gem-documentation-server/#comments</comments>
		<pubDate>Thu, 06 Dec 2007 01:01:19 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[ruby gems gemserver]]></category>

		<guid isPermaLink="false">http://matthall.wordpress.com/2007/12/06/gem-documentation-server/</guid>
		<description><![CDATA[Just a quick tip I recently came across:
If you want to see the docs for any of the gems installed on your dev machine, type the following in the command line&#8230;

gem_server

&#8230;and then browse over to http://localhost:8808/!
       <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=matthall.wordpress.com&blog=17453&post=33&subd=matthall&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Just a quick tip I recently came across:</p>
<p>If you want to see the docs for any of the gems installed on your dev machine, type the following in the command line&#8230;</p>
<pre class="brush: ruby;">
gem_server
</pre>
<p>&#8230;and then browse over to <a href="http://localhost:8808/">http://localhost:8808/</a>!</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/matthall.wordpress.com/33/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/matthall.wordpress.com/33/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/matthall.wordpress.com/33/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/matthall.wordpress.com/33/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/matthall.wordpress.com/33/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/matthall.wordpress.com/33/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/matthall.wordpress.com/33/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/matthall.wordpress.com/33/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/matthall.wordpress.com/33/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/matthall.wordpress.com/33/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/matthall.wordpress.com/33/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/matthall.wordpress.com/33/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=matthall.wordpress.com&blog=17453&post=33&subd=matthall&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://matthall.wordpress.com/2007/12/06/gem-documentation-server/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/f6925b0d9a374a15f8ba30a11b14f323?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">matthall</media:title>
		</media:content>
	</item>
	</channel>
</rss>