<?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>without-brains.net &#187; Ruby</title>
	<atom:link href="http://www.without-brains.net/archives/tag/ruby/feed" rel="self" type="application/rss+xml" />
	<link>http://www.without-brains.net</link>
	<description>A software developer&#039;s blog</description>
	<lastBuildDate>Wed, 08 Sep 2010 20:26:37 +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>Ruby on Rails 3 and UJS</title>
		<link>http://www.without-brains.net/archives/368</link>
		<comments>http://www.without-brains.net/archives/368#comments</comments>
		<pubDate>Wed, 08 Sep 2010 18:16:58 +0000</pubDate>
		<dc:creator>Mark</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[UJS]]></category>

		<guid isPermaLink="false">http://www.without-brains.net/?p=368</guid>
		<description><![CDATA[On August the 29th Ruby on Rails 3 was been released, the Rails team has made a series of screencasts available about the changes in Rails 3 here. Ryan Bates also made a series of screencasts about Rails 3 on &#8230; <a href="http://www.without-brains.net/archives/368">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>On August the 29th <a title="Ruby on Rails" href="http://rubyonrails.org/">Ruby on Rails</a> 3 was been released, the Rails team has made a series of screencasts available about the changes in Rails 3 <a title="Rails 3 screencasts" href="http://rubyonrails.org/screencasts/rails3">here</a>. Ryan Bates also made a series of screencasts about Rails 3 on Railscasts.com <a title="Railscasts Rails 3 screencasts" href="http://railscasts.com/tags/27">here</a>. Let me start this article by thanking everyone for their hard work on Ruby on Rails 3, it&#8217;s a fantastic release!</p>
<p>Now to dive into the subject of this article, one of the new features in Rails 3 that I really like is the use of UJS (Unobtrusive JavaScript) taking away all the inline Javascript that was generated by Rails inline within your HTML. UJS has many advantages over inline Javascript, the main advantages in my opinion being that Javascript is now no longer treated as a second class citizen, more easily managed (because it isn&#8217;t all over the place anymore) and that it makes it easier to build pages that work with and without Javascript.<span id="more-368"></span></p>
<p>For those of us that have been using the existing AJAX functionality in Rails 1 and Rails 2 it involves a bit of work. Helper methods such as link_to_remote and remote_form_for have been taken away, instead you now specify :remote =&gt; true as part of the options to the helpers that they were AJAX alternates for (such as link_to and form_for). Specifying the :remote =&gt; true option adds a custom attribute to the tag: data-remote=&#8221;true&#8221;. Javascript event observing is used to properly trigger the AJAX requests on click or submit (depending on which helper it&#8217;s being used on). If you take a look at the file public/javascripts/rails.js you&#8217;ll see how it works exactly (assuming that you understand Javascript and the <a title="Prototype Javascript framework" href="http://prototypejs.org">Prototype</a> framework).</p>
<p><a title="Railscast 205" href="http://railscasts.com/episodes/205-unobtrusive-javascript"></a></p>
<p>The standard callbacks that used to exist as part of the remote functions are now gone too (you could pass in options such as :success, :failure, :before, :after, etc.), instead you will have to program them in Javascript. One of the upsides is that you can specify global behavior for all your AJAX requests by observing the &#8220;ajax:*&#8221; events (public/javascript/rails.js details which ones are fired). This can be incredibly useful per example when you want to show a spinner for your AJAX requests, you simply observe the &#8220;ajax:before&#8221; and &#8220;ajax:after&#8221; to show and hide the spinner in application.js (making this behavior available on all your pages instantly, very DRY!). You could even influence the behavior for each AJAX request with additional custom data attributes (per example the id of the spinner to show and hide).</p>
]]></content:encoded>
			<wfw:commentRss>http://www.without-brains.net/archives/368/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to build and release Rubygems</title>
		<link>http://www.without-brains.net/archives/286</link>
		<comments>http://www.without-brains.net/archives/286#comments</comments>
		<pubDate>Sat, 03 Apr 2010 05:48:20 +0000</pubDate>
		<dc:creator>Mark</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://www.without-brains.net/?p=286</guid>
		<description><![CDATA[Yehuda Katz wrote up an excellent description of the procedures to build and release gems on his blog. You can find it here: http://yehudakatz.com/2010/04/02/using-gemspecs-as-intended/]]></description>
			<content:encoded><![CDATA[<p>Yehuda Katz wrote up an excellent description of the procedures to build and release gems on his <a title="blog" href="http://yehudakatz.com/">blog</a>. You can find it here: <a href="http://yehudakatz.com/2010/04/02/using-gemspecs-as-intended/">http://yehudakatz.com/2010/04/02/using-gemspecs-as-intended/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.without-brains.net/archives/286/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Issue while upgrading Rails from 2.1.2 to 2.3.4</title>
		<link>http://www.without-brains.net/archives/157</link>
		<comments>http://www.without-brains.net/archives/157#comments</comments>
		<pubDate>Sun, 29 Nov 2009 18:34:38 +0000</pubDate>
		<dc:creator>Mark</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://www.without-brains.net/?p=157</guid>
		<description><![CDATA[At work we recently upgraded from Rails 2.1.2 to Rais 2.3.4. Lots of good improvements in 2.3.4, my compliments to everyone who made the new release possible! The upgrade was relatively problem free, the only real issue that we ran &#8230; <a href="http://www.without-brains.net/archives/157">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>At work we recently upgraded from Rails 2.1.2 to Rais 2.3.4. Lots of good improvements in 2.3.4, my compliments to everyone who made the new release possible!</p>
<p>The upgrade was relatively problem free, the only real issue that we ran into was that somewhere in between 2.1.2 and 2.3.4 the *_tag helpers (text_field_tag and such) have started behaving slightly different in relation to element ids. These helper methods now call the undocumented sanitize_to_id method, which cleans up the element ids by getting rid of characters such as [ and ] and putting in underscores instead.<span id="more-157"></span> While this is a good change (the form_for helpers were already converting the field names to such element ids, so this change makes the helpers more consistent), it was unexpected (I have not seen any documentation referencing it, not in the 2.2 or 2.3 release notes). This changed a lot of ids in web forms that we were using, and it broke a fair bit of custom Javascript which we had to repair.</p>
<p>So, if you&#8217;re upgrading Rails from 2.1.2 or older to 2.3.4 ensure that you check your views for custom Javascript to ensure that any fields generated by the *_tag helper methods that are being referenced with Javascript are referenced properly.</p>
<p>Happy coding!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.without-brains.net/archives/157/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Making SQLite 3 work with JRuby and Rails</title>
		<link>http://www.without-brains.net/archives/132</link>
		<comments>http://www.without-brains.net/archives/132#comments</comments>
		<pubDate>Thu, 26 Nov 2009 20:49:19 +0000</pubDate>
		<dc:creator>Mark</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[ActiveRecord]]></category>
		<category><![CDATA[Blog]]></category>
		<category><![CDATA[Derby]]></category>
		<category><![CDATA[JRuby]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PostgreSQL]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[SQLite]]></category>
		<category><![CDATA[Website]]></category>

		<guid isPermaLink="false">http://www.without-brains.net/?p=132</guid>
		<description><![CDATA[In my previous post I indicated that I am using Ruby on Rails and JRuby for my new blogging tool. As underlying database I have decided to go with the Rails default: SQLite. SQLite has the advantage that it is &#8230; <a href="http://www.without-brains.net/archives/132">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>In my previous post I indicated that I am using <a title="Ruby on Rails" href="http://www.rubyonrails.org">Ruby on Rails</a> and <a title="JRuby" href="http://www.jruby.org">JRuby</a> for my new blogging tool. As underlying database I have decided to go with the Rails default: <a title="SQLite" href="http://www.sqlite.org">SQLite</a>. SQLite has the advantage that it is an embeddable database, so you don&#8217;t need a separate database server to use it (which is very convenient when developing software). Note that when you are using JRuby you can also use <a title="Apache Derby" href="http://db.apache.org/derby/">Apache Derby</a> (which is an embeddable database written in Java) instead of SQLite if you want to.<span id="more-132"></span></p>
<p>When you use the standard version of Ruby getting SQLite support is easy, you just install the sqlite3-ruby gem (gem install sqlite3-ruby) and you&#8217;re done (you need to have the SQLite libraries and dev headers installed on your system already of course). This does not work for JRuby because the sqlite3-ruby is a native gem (containing C code with extensions on standard Ruby).</p>
<p>So how do you get SQLite to work with JRuby and Rails? Get the gems for JRuby! Assuming that you have SQLite installed on your system, you simply need to install the activerecord-jdbcsqlite3-adapter gem (this will automatically try to install the activerecord-jdbc-adapter and jdbc-sqlite3 gems if you don&#8217;t already have them). In your Rails project edit config/database.yml and change the adapter type to jdbcsqlite3 and you&#8217;re done <img src='http://www.without-brains.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>There are a number of activerecord-jdbc gems available (just type &#8220;gem search &#8211;remote activerecord-jdbc&#8221; in your shell to see them), including connectors for Apache Derby, <a title="MySQL" href="http://www.mysql.com">MySQL</a> and <a title="PostgreSQL" href="http://www.postgresql.org">PostgreSQL</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.without-brains.net/archives/132/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Scratching your own itch</title>
		<link>http://www.without-brains.net/archives/116</link>
		<comments>http://www.without-brains.net/archives/116#comments</comments>
		<pubDate>Wed, 25 Nov 2009 20:28:46 +0000</pubDate>
		<dc:creator>Mark</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Blog]]></category>
		<category><![CDATA[Drupal]]></category>
		<category><![CDATA[JRuby]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Website]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://www.without-brains.net/?p=116</guid>
		<description><![CDATA[Today at work I spoke with one of my colleagues about my desire to develop something to run this weblog on myself, and the reasons that were stopping me from doing it (originally written in this post). His response was &#8230; <a href="http://www.without-brains.net/archives/116">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Today at work I spoke with one of my colleagues about my desire to develop something to run this weblog on myself, and the reasons that were stopping me from doing it (originally written in this <a title="Blog post" href="http://www.without-brains.net/archives/9">post</a>). His response was incredibly clever: &#8220;Why don&#8217;t you develop your own blogging tool at your own pace, while blogging about it on something existing now?&#8221;. It&#8217;s good advice that I have decided to take!<span id="more-116"></span></p>
<p>A term that&#8217;s uttered quite often by software developers everywhere is that they like to &#8220;scratch their own itch&#8221;, and I felt the same way when I started looking at software for my website again. While there are certainly good blogging tools and content management systems and frameworks out there, none of these seem to be exactly what I want (often they do a lot of things that I don&#8217;t want, and they lack a few things that I do want). While <a title="WordPress" href="http://www.wordpress.org">WordPress</a> is certainly sufficient for the time being, I know I want to make something that scratches my itch <img src='http://www.without-brains.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Most of the existing products that I have seen and tried are written in <a title="PHP" href="http://www.php.net">PHP</a> (examples are: <a title="WordPress" href="http://www.wordpress.org">WordPress</a>, <a title="Drupal" href="http://www.drupal.org">Drupal</a>, <a title="Joomla" href="http://www.joomla.org/">Joomla</a> and more). Instead I&#8217;ll be using my preferred web application framework: <a title="Ruby on Rails" href="http://www.rubyonrails.org">Ruby on Rails</a>. I&#8217;ll be using <a title="JRuby" href="http://www.jruby.org/">JRuby</a> instead of regular <a title="Ruby" href="http://www.ruby-lang.org/">Ruby</a>, at least for development. I&#8217;ve heard good things about JRuby so far, using it for this project will give me a good chance to see how well it works.</p>
<p>As suggested by my colleague, I will be blogging here about my progress&#8230; so stay tuned <img src='http://www.without-brains.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.without-brains.net/archives/116/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
