<?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>Meeho!™ &#187; Blog &#187; Ruby on Rails</title>
	<atom:link href="http://www.meeho.net/blog/category/ruby-on-rails/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.meeho.net/blog</link>
	<description>This is the official blog about Meeho!™, the platform for getting your business organized.</description>
	<lastBuildDate>Sat, 04 Jun 2011 23:06:23 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Fixing the &quot;NoMethodError: undefined method &#8216;to_sym&#8217; for false:FalseClass&quot; error when working with I18n in Ruby on Rails</title>
		<link>http://www.meeho.net/blog/2011/02/fixing-the-nomethoderror-undefined-method-to_sym-for-falsefalseclass-error-when-working-with-i18n-in-ruby-on-rails/</link>
		<comments>http://www.meeho.net/blog/2011/02/fixing-the-nomethoderror-undefined-method-to_sym-for-falsefalseclass-error-when-working-with-i18n-in-ruby-on-rails/#comments</comments>
		<pubDate>Mon, 14 Feb 2011 16:20:03 +0000</pubDate>
		<dc:creator>Kasper Tidemann</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Ruby on Rails]]></category>

		<guid isPermaLink="false">http://www.meeho.net/blog/?p=1489</guid>
		<description><![CDATA[If you are in the middle of setting up internationalization in your brand spanking new Ruby on Rails project, you might have added a few locales including a Norwegian one for those lovely people up in northern Scandinavia. Now, having done this, trying to call &#60;%= I18n.t(&#8216;hello_world&#8217;) %&#62;, you might receive the following error: NoMethodError: [...]]]></description>
			<content:encoded><![CDATA[<p>If you are in the middle of setting up internationalization in your brand spanking new Ruby on Rails project, you might have added a few locales including a Norwegian one for those lovely people up in northern Scandinavia.</p>
<p>Now, having done this, trying to call <em>&lt;%= I18n.t(&#8216;hello_world&#8217;) %&gt;</em>, you might receive the following error:</p>
<blockquote><p><strong>NoMethodError</strong>: undefined method `to_sym&#8217; for false:FalseClass</p></blockquote>
<p>You look in your YAML files, say <em>en.yml</em> and <em>no.yml</em>, and what you have is this:</p>
<blockquote><p>
<strong># English locale file:</strong></p>
<p>en:<br />
&nbsp;&nbsp;hello_world: &#8216;Hello world!&#8217;
</p></blockquote>
<p>&#8230; and&#8230;</p>
<blockquote><p>
<strong># Norwegian locale file:</strong></p>
<p>no:<br />
&nbsp;&nbsp;hello_world: &#8216;Hej verden!&#8217;
</p></blockquote>
<p>The above is a classical YAML thing: the <em>no:</em> contained in the <em>no.yml</em> file is interpreted as a boolean, and this renders the Norwegian YAML file useless &mdash; and thus, your dandy I18n attempts bork up.</p>
<p>The solution is simple:</p>
<blockquote><p>
<strong># Norwegian locale file:</strong></p>
<p>&quot;no&quot;:<br />
&nbsp;&nbsp;hello_world: &#8216;Hej verden!&#8217;
</p></blockquote>
<p>Escape the <em>no:</em> with quotation marks and you&#8217;re good to go.</p>
<div class="shr-publisher-1489"></div>]]></content:encoded>
			<wfw:commentRss>http://www.meeho.net/blog/2011/02/fixing-the-nomethoderror-undefined-method-to_sym-for-falsefalseclass-error-when-working-with-i18n-in-ruby-on-rails/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>How to do a RubyGems selfupdate</title>
		<link>http://www.meeho.net/blog/2010/11/how-to-do-a-rubygems-selfupdate/</link>
		<comments>http://www.meeho.net/blog/2010/11/how-to-do-a-rubygems-selfupdate/#comments</comments>
		<pubDate>Mon, 22 Nov 2010 19:00:04 +0000</pubDate>
		<dc:creator>Kasper Tidemann</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[Tech stuff]]></category>

		<guid isPermaLink="false">http://www.meeho.net/blog/?p=1312</guid>
		<description><![CDATA[I was just looking for this, because I forgot the command and issuing gem help doesn&#8217;t say a word about it &#8212; at least I couldn&#8217;t find it. To do a so-called selfupdate of your gem (RubyGems) installation, run the following command: sudo gem update &#8211;system (Those are two dashes and not just one, in [...]]]></description>
			<content:encoded><![CDATA[<p>I was just looking for this, because I forgot the command and issuing <em>gem help</em> doesn&#8217;t say a word about it &mdash; at least I couldn&#8217;t find it. To do a so-called selfupdate of your gem (RubyGems) installation, run the following command:</p>
<blockquote><p>sudo gem update &#8211;system</p></blockquote>
<p><span style="font-size: 12px;">(Those are two dashes and not just one, in cause your browser displays them as one.)</span></p>
<p>There you go.</p>
<div class="shr-publisher-1312"></div>]]></content:encoded>
			<wfw:commentRss>http://www.meeho.net/blog/2010/11/how-to-do-a-rubygems-selfupdate/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>A brief history of Prototype, script.aculo.us, and my opionion on what really facilitated the Web 2.0 revolution</title>
		<link>http://www.meeho.net/blog/2010/10/a-brief-history-of-prototype-script-aculo-us-and-my-opionion-on-what-really-started-the-web-2-0-revolution/</link>
		<comments>http://www.meeho.net/blog/2010/10/a-brief-history-of-prototype-script-aculo-us-and-my-opionion-on-what-really-started-the-web-2-0-revolution/#comments</comments>
		<pubDate>Sun, 31 Oct 2010 16:10:45 +0000</pubDate>
		<dc:creator>Kasper Tidemann</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Prototype JS]]></category>
		<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[script.aculo.us]]></category>

		<guid isPermaLink="false">http://www.meeho.net/blog/?p=1177</guid>
		<description><![CDATA[It&#8217;s a lazy Sunday in Copenhagen suburbia with a light, greyish veil spread across the city. I&#8217;ve armed myself with a cup of coffee and my Debian laptop, fiddling with new packages and reading up on stuff that&#8217;s happened the past couple of weeks. Prototype will soon be out in version 1.7. Prototype, you ask? [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s a lazy Sunday in Copenhagen suburbia with a light, greyish veil spread across the city. I&#8217;ve armed myself with a cup of coffee and my Debian laptop, fiddling with new packages and reading up on stuff that&#8217;s happened the past couple of weeks.</p>
<p><a title="Prototype JS" href="http://www.prototype.js.org">Prototype</a> will soon be out in version 1.7. Prototype, you ask? What is it and why should you care? Let&#8217;s dive into what it&#8217;s all about.</p>
<p>You know it from apple.com, nbc.com, cnn.com, digg, DailyMotion and other huge web sites on the Internet. You know it from Meeho!&#8482;. Even though you may not be aware of it, they all use Prototype for DOM selecting, element manipulation etc., and have been doing so for quite a while now.</p>
<p>So, Prototype is a JavaScript framework for working with the DOM. It makes it easy to select and manipulate elements in your HTML code and besides, it&#8217;s got functions that aim to eliminate the differences of browsers when developing web sites &mdash; the Element.Layout methods is a prime example of this.</p>
<p>Prototype was originally developed by <a href="http://sstephenson.us/">Sam Stephenson</a>, a core developer of Ruby on Rails. It was developed to underline the whole <em>render :update do |page|</em> functionality in Rails &mdash; or what you know as AJAX. In February 2005, the first version of Prototype was released.</p>
<p>Some of you might know Prototype, and you may know jQuery. But jQuery was released nearly a year later, in January 2006, and is more of a library than a framework, which is what Prototype is (architecturally anyway, someone should really write a post on the differences between the two).</p>
<p>Now, Prototype got released, and lots of developers ditched their own home grown code in favor of the dollar function and all the other cool features that Prototype sported. User-centered manipulation of the elements of a web page took the stage, and so did an Austrian web developer, who came to play an important &mdash; and yet to be fully acknowledged &mdash; part of the Web 2.0 revolution. His name is <a href="http://mir.aculo.us/">Thomas Fuchs</a>.</p>
<p>Alright, revolution is a somewhat worn-out word when talking computers and the Internet. But Thomas Fuchs&#8217; work was and still is important. What he did? He released his <a href="http://script.aculo.us">script.aculo.us</a> JavaScript extension of Prototype.</p>
<p>All of a sudden, web developers worldwide gained access to all sorts of effects, controls and handy utilities (like the effect queue), which rapidly got implemented on web sites across the globe &mdash; including the web sites of Apple, Gucci, and IKEA. This is when you began to see the Internet develop past completely static pages into the more user-driven experience it has become today.</p>
<p>But this is not the whole story. Without the help of Microsoft, the notorious bad guy of the lot, without their XMLHttpRequest API originally developed for the Outlook Web Access feature of the Exchange 2000 mail server, the whole revolution would never have started. The whole story consists of numerous small nodes in the giant tree that is the current state of the Internet, and everyone has played a small but vital part in what we now have created.</p>
<p>In my opinion, we would never have come this far without the help of Sam Stephenson and the whole Prototype JS framework, without the eye-opening experience that script.aculo.us brought us thanks to Thomas Fuchs, and without the massive support that these guys gained throughout the web development community.</p>
<p>For now, I wish to say a big thank you to Sam Stephenson and Thomas Fuchs. You guys are brilliant. Thank you.</p>
<div class="shr-publisher-1177"></div>]]></content:encoded>
			<wfw:commentRss>http://www.meeho.net/blog/2010/10/a-brief-history-of-prototype-script-aculo-us-and-my-opionion-on-what-really-started-the-web-2-0-revolution/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>This is how you format your own XML in Ruby on Rails</title>
		<link>http://www.meeho.net/blog/2010/10/this-is-how-you-format-your-own-xml-in-ruby-on-rails/</link>
		<comments>http://www.meeho.net/blog/2010/10/this-is-how-you-format-your-own-xml-in-ruby-on-rails/#comments</comments>
		<pubDate>Mon, 11 Oct 2010 21:25:19 +0000</pubDate>
		<dc:creator>Kasper Tidemann</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[Tech stuff]]></category>

		<guid isPermaLink="false">http://www.meeho.net/blog/?p=999</guid>
		<description><![CDATA[Here is the situation: you&#8217;ve got your own Ruby on Rails application, and you need to create an API that spits out XML for use somewhere. This is what you could be doing: respond_to do &#124;format&#124; &#160;&#160;format.xml { render :xml =&#62; @users.to_xml end The above will create and return fully functional XML which is all [...]]]></description>
			<content:encoded><![CDATA[<p>Here is the situation: you&#8217;ve got your own Ruby on Rails application, and you need to create an API that spits out XML for use somewhere. This is what you could be doing:</p>
<blockquote><p>
respond_to do |format|<br />
&nbsp;&nbsp;format.xml { render :xml =&gt; @users.to_xml<br />
end
</p></blockquote>
<p>The above will create and return fully functional XML which is all good and dandy.</p>
<p>Well, it&#8217;s not. The above will mirror each and every detail about your <em>users</em> table in your database. But what if you don&#8217;t want to include the user passwords in the XML? What if you want to rename one of the fields to something else in your XML?</p>
<p>You use the <a href="http://builder.rubyforge.org/">Builder</a>. With the help of the Builder, you can modify the XML to look like anything you want and not just mirror your table structure completely. Here is how you use the Builder:</p>
<blockquote><p>
xml = Builder::XmlMarkup.new<br />
xml.instruct!<br />
xml.users do<br />
&nbsp;&nbsp;@users.each { |user|<br />
&nbsp;&nbsp;&nbsp;&nbsp;xml.username user.username<br />
&nbsp;&nbsp;&nbsp;&nbsp;xml.email user.email_address<br />
&nbsp;&nbsp;&nbsp;&nbsp;xml.<strong>write-whatever-you-want-here</strong> user.<strong>whichever-field-you-need</strong><br />
&nbsp;&nbsp;}<br />
end</p>
<p>respond_to do |format|<br />
&nbsp;&nbsp;format.xml { render :xml => xml.target! }<br />
end
</p></blockquote>
<p>The above code creates a new Builder object, then defines for a set of <em>users</em> to be shown in the XML. Then, the <em>@users</em> array is processed, and inside each <em>user</em> node in the XML you&#8217;re pretty much able to do whatever you want &#8211; including calling other methods you might need on-the-fly.</p>
<p>So whenever you need just a tad bit more freedom when working with XML, discard the <em>.to_xml</em> approach and create your own Builder object. That works like a charm!</p>
<div class="shr-publisher-999"></div>]]></content:encoded>
			<wfw:commentRss>http://www.meeho.net/blog/2010/10/this-is-how-you-format-your-own-xml-in-ruby-on-rails/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Simple XML serialization in Ruby on Rails</title>
		<link>http://www.meeho.net/blog/2010/04/beautiful-xml-serialization-in-ruby-on-rails/</link>
		<comments>http://www.meeho.net/blog/2010/04/beautiful-xml-serialization-in-ruby-on-rails/#comments</comments>
		<pubDate>Sun, 11 Apr 2010 23:55:57 +0000</pubDate>
		<dc:creator>Kasper Tidemann</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Ruby on Rails]]></category>

		<guid isPermaLink="false">http://www.meeho.net/blog/?p=900</guid>
		<description><![CDATA[Having looked into it for a few minutes, I was quite sure I needed to override the to_xml method in order to get the XML output I wanted for some functionality in Meeho!™. But I found that Ruby on Rails is quite capable of including the relation I was looking for by using :include as [...]]]></description>
			<content:encoded><![CDATA[<p>Having looked into it for a few minutes, I was quite sure I needed to override the <em>to_xml</em> method in order to get the XML output I wanted for some functionality in Meeho!™. But I found that Ruby on Rails is quite capable of including the relation I was looking for by using <em>:include</em> as seen below. Beautiful!</p>
<div id="attachment_901" class="wp-caption aligncenter" style="width: 540px"><img class="size-full wp-image-901" title="Easy XML serialization in Ruby on Rails. Beautiful!" src="http://www.meeho.net/blog/wp-content/uploads/RubyEasyXMLGeneration.jpg" alt="Easy XML serialization in Ruby on Rails. Beautiful!" width="530" height="95" /><p class="wp-caption-text">Easy XML serialization in Ruby on Rails. Beautiful!</p></div>
<div class="shr-publisher-900"></div>]]></content:encoded>
			<wfw:commentRss>http://www.meeho.net/blog/2010/04/beautiful-xml-serialization-in-ruby-on-rails/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

