<?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:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>n o t e 1 9 . c o m &#187; Ruby on Rails</title>
	<atom:link href="http://note19.com/category/ruby/feed/" rel="self" type="application/rss+xml" />
	<link>http://note19.com</link>
	<description></description>
	<lastBuildDate>Fri, 03 Feb 2012 14:43:52 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='note19.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>n o t e 1 9 . c o m &#187; Ruby on Rails</title>
		<link>http://note19.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://note19.com/osd.xml" title="n o t e 1 9 . c o m" />
	<atom:link rel='hub' href='http://note19.com/?pushpress=hub'/>
		<item>
		<title>Rails 2 and broken render_text</title>
		<link>http://note19.com/2008/02/24/rails-2-and-render_text/</link>
		<comments>http://note19.com/2008/02/24/rails-2-and-render_text/#comments</comments>
		<pubDate>Sun, 24 Feb 2008 02:05:57 +0000</pubDate>
		<dc:creator>Shahram Javey</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Ruby on Rails]]></category>

		<guid isPermaLink="false">http://note19.com/2008/02/24/rails-2-and-render_text/</guid>
		<description><![CDATA[Looks like that in Rails 2, in addition to changing the default database, default sessions store, now some of the oldies such as render_text method no longer work as expected. If you&#8217;ve used render_text "some text" in a controller, then you&#8217;ll need to replace it with render :text =&#62; "some text".<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=note19.com&amp;blog=1100651&amp;post=339&amp;subd=note19&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Looks like that in Rails 2, in addition to changing the default database, default sessions store, now some of the oldies such as render_text method no longer work as expected. If you&#8217;ve used <code>render_text "some text"</code> in a controller, then you&#8217;ll need to replace it with <code>render :text =&gt; "some text"</code>.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/note19.wordpress.com/339/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/note19.wordpress.com/339/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/note19.wordpress.com/339/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/note19.wordpress.com/339/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/note19.wordpress.com/339/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/note19.wordpress.com/339/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/note19.wordpress.com/339/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/note19.wordpress.com/339/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/note19.wordpress.com/339/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/note19.wordpress.com/339/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/note19.wordpress.com/339/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/note19.wordpress.com/339/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/note19.wordpress.com/339/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/note19.wordpress.com/339/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/note19.wordpress.com/339/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/note19.wordpress.com/339/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=note19.com&amp;blog=1100651&amp;post=339&amp;subd=note19&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://note19.com/2008/02/24/rails-2-and-render_text/feed/</wfw:commentRss>
		<slash:comments>15</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/f6955c88abe26707bceccc55642e7e58?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Shahram</media:title>
		</media:content>
	</item>
		<item>
		<title>Rails 2 and broken sessions</title>
		<link>http://note19.com/2008/02/24/rails-2-and-broken-sessions/</link>
		<comments>http://note19.com/2008/02/24/rails-2-and-broken-sessions/#comments</comments>
		<pubDate>Sun, 24 Feb 2008 01:34:07 +0000</pubDate>
		<dc:creator>Shahram Javey</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Ruby on Rails]]></category>

		<guid isPermaLink="false">http://note19.wordpress.com/?p=337</guid>
		<description><![CDATA[My hosting company (bluehost.com) updates their system software now and then without any e-mail notifications to their users. Unfortunately, if you host a Ruby on Rails application (in my case sharepdf.com) each time they upgrade Ruby on Rails, there is a good chance that something will break. Recently, they upgraded to the latest version of [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=note19.com&amp;blog=1100651&amp;post=337&amp;subd=note19&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>My hosting company (<a href="http://bluehost.com">bluehost.com</a>) updates their system software now and then without any e-mail notifications to their users. Unfortunately, if you host a Ruby on Rails application (in my case <a href="http://sharepdf.com">sharepdf.com</a>) each time they upgrade Ruby on Rails, there is a good chance that something will break. Recently, they upgraded to the latest version of Rails (2.0.2) and needless to say, my Rails application stopped working. It turns out that the latest version of Rails has changed the default sessions store from a file store to a cookie store. The problem is that if you stored anything other than a simple data in your session, then to get your application to work, you have to spend a few days porting your application. The fact that Rails upgrade is not backwardly compatible is really annoying. But that is a separate issue.</p>
<p>So what is the easiest way to port your file backed sessions application to Rails 2? The answer is to use the database for your sessions. But keep in mind that Rails 2 no longer uses MySQL as its default database. Here is how I ported my sharepdf.com application to Rails 2.0.2:</p>
<ol>
<li>Create a brand new rails application using the command <code>rails -d mysql <i>appname</i></code></li>
<li>Edit environment.rb file and explicity state that you wish to use database for sessions: simply uncomment this line:<br />
<code>config.action_controller.session_store = :active_record_store</code>.</li>
<li>Use the command <code>rake db:sessions:create</code> to create the database definition for the sessions.</li>
<li>Use the command <code>rake db:migrate</code> to actually create the database tables (I&#8217;m assuming that you have updated the <code>database.yml</code> with correct user name and password and have create the database in MySQL). The <code>rake</code> command will then create the sessions database table.</li>
<li>Copy your controllers, models, views, &#8230; from the your current Rails application to this one.</li>
<li>You should be good to go!</li>
</ol>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/note19.wordpress.com/337/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/note19.wordpress.com/337/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/note19.wordpress.com/337/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/note19.wordpress.com/337/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/note19.wordpress.com/337/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/note19.wordpress.com/337/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/note19.wordpress.com/337/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/note19.wordpress.com/337/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/note19.wordpress.com/337/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/note19.wordpress.com/337/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/note19.wordpress.com/337/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/note19.wordpress.com/337/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/note19.wordpress.com/337/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/note19.wordpress.com/337/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/note19.wordpress.com/337/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/note19.wordpress.com/337/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=note19.com&amp;blog=1100651&amp;post=337&amp;subd=note19&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://note19.com/2008/02/24/rails-2-and-broken-sessions/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/f6955c88abe26707bceccc55642e7e58?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Shahram</media:title>
		</media:content>
	</item>
		<item>
		<title>Rails config/environment.rb</title>
		<link>http://note19.com/2007/10/23/rails-configenvironmentrb/</link>
		<comments>http://note19.com/2007/10/23/rails-configenvironmentrb/#comments</comments>
		<pubDate>Tue, 23 Oct 2007 02:56:16 +0000</pubDate>
		<dc:creator>Shahram Javey</dc:creator>
				<category><![CDATA[Adobe Share]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Ruby on Rails]]></category>

		<guid isPermaLink="false">http://note19.com/2007/10/23/rails-configenvironmentrb/</guid>
		<description><![CDATA[Today the company I host my sharepdf.com site updated their Rails platform from 1.2.3 to 1.2.5 and all of sudden my Ruby on Rails application that gives users an HTML (suitable for an iPhone) view of the Adobe Share library stopped working. The following error message kept appearing in the error log: Cannot find gem [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=note19.com&amp;blog=1100651&amp;post=256&amp;subd=note19&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Today the <a href="http://www.bluehost.com">company</a> I host my <a href="http://sharepdf.com">sharepdf.com</a> site updated their Rails platform from 1.2.3 to 1.2.5 and all of sudden my Ruby on Rails application that gives users an HTML  (suitable for an iPhone) view of the Adobe Share library stopped working. The following error message kept appearing in the error log:</p>
<p><code><br />
Cannot find gem for Rails ~&gt;1.2.3.0: Install the missing gem with 'gem install -v=1.2.3 rails', or change environment.rb to define RAILS_GEM_VERSION with your desired version.<br />
</code></p>
<p>I had to edit the <code>config/environment.rb</code> file and update the Rails version from 1.2.3 to 1.2.5.</p>
<pre><code>
<em><font color="green"># Specifies gem version of Rails to use when vendor/rails is not present</font></em>
RAILS_GEM_VERSION = '1.2.5' unless defined? RAILS_GEM_VERSION
</code></pre>
<p>This change fixed the problem.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/note19.wordpress.com/256/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/note19.wordpress.com/256/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/note19.wordpress.com/256/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/note19.wordpress.com/256/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/note19.wordpress.com/256/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/note19.wordpress.com/256/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/note19.wordpress.com/256/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/note19.wordpress.com/256/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/note19.wordpress.com/256/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/note19.wordpress.com/256/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/note19.wordpress.com/256/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/note19.wordpress.com/256/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/note19.wordpress.com/256/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/note19.wordpress.com/256/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/note19.wordpress.com/256/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/note19.wordpress.com/256/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=note19.com&amp;blog=1100651&amp;post=256&amp;subd=note19&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://note19.com/2007/10/23/rails-configenvironmentrb/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/f6955c88abe26707bceccc55642e7e58?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Shahram</media:title>
		</media:content>
	</item>
		<item>
		<title>Adobe SHARE for your iPhone</title>
		<link>http://note19.com/2007/10/02/adobe-share-on-your-iphone/</link>
		<comments>http://note19.com/2007/10/02/adobe-share-on-your-iphone/#comments</comments>
		<pubDate>Tue, 02 Oct 2007 06:57:00 +0000</pubDate>
		<dc:creator>Shahram Javey</dc:creator>
				<category><![CDATA[Adobe Share]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Ruby on Rails]]></category>

		<guid isPermaLink="false">http://note19.com/2007/10/02/adobe-share-on-your-iphone/</guid>
		<description><![CDATA[Adobe today released a beautiful looking online service called Adobe SHARE (beta). Share can be viewed as your online document library in the clouds. You can easily upload a document and share it with others. A thumbnail and an Adobe Flash preview of most document types are automatically created and the Flash preview can be [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=note19.com&amp;blog=1100651&amp;post=233&amp;subd=note19&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="https://share.adobe.com/" title="Adobe SHARE"><img src="http://note19.files.wordpress.com/2007/10/adobeshare.thumbnail.png?w=450" class="alignleft" alt="Adobe SHARE" /></a>Adobe today released a beautiful looking online service called Adobe <a href="https://share.adobe.com/">SHARE</a> (beta).  Share can be viewed as your online document library in the clouds. You can easily upload a document and share it with others. A thumbnail and an Adobe Flash preview of most document types  are automatically created and the Flash preview can be embedded in most blogs. At this point the share service requires a browser with latest version of the Adobe Flash plug-in.</p>
<p><a href="http://web.sharepdf.com" title="Share PDF"><img src="http://note19.files.wordpress.com/2007/10/share.thumbnail.png?w=450" class="alignright" alt="Share PDF" /></a>In addition, today Adobe also released the <a href="https://api.share.adobe.com">web services</a> for SHARE. The web services offer a simple REST based API to access Share libraries. You can use the web services to create mash-ups. In my quest to learn Ruby on Rails. I&#8217;ve written a simple application (based on the <a href="http://www.amazon.com/gp/search?ie=UTF8&amp;keywords=RailsSpaces&amp;tag=httpjaveynet-20&amp;index=books&amp;linkCode=ur2&amp;camp=1789&amp;creative=9325">RailsSpaces</a><img src="http://www.assoc-amazon.com/e/ir?t=httpjaveynet-20&amp;l=ur2&amp;o=1" style="border:medium none !important;margin:0 !important;" border="0" height="1" width="1" /> book) that allows you to view your Share library using plain old HTML. I wanted to access my Share library on my iPhone (which has an excellent support for PDF and other file formats). The current <a href="http://web.sharepdf.com">mash-up</a> &#8211; <a href="http://web.sharepdf.com/">http://web.sharepdf.com/</a> &#8211; is not speedy,  nothing is currently cached and there are lots of other applications running on this server. You can see the source code <a href="http://note19.googlecode.com/svn/trunk/pdf/">here</a>.</p>
<blockquote><p> There are a couple of minor bugs in the current web services &amp; this mash-up:</p>
<ul>
<li>The XML requests cannot contain any new line characters. For now, just send your XML request as one long string with no line breaks.</li>
<li>Ruby returns the current time in seconds. Share API requires the time in mili-seconds, so consecutive calls may appear to be issued at the same time. Just add a sleep in between the calls, e.g., to insert &#8220;sleep 1&#8243; when you iterate over the list of your documents.</li>
<li>There is a typo in the API <a href="http://labs.adobe.com/wiki/index.php/Share#Accessing_file_renditions">documentation</a>, the URL to get the source document must end in <code>src</code> and not in <code>source</code>. See the definition of the method <a href="http://note19.googlecode.com/svn/trunk/pdf/app/controllers/user_controller.rb">src</a>.</li>
<li>I tweaked the <a href="http://note19.googlecode.com/svn/trunk/pdf/public/stylesheets/site.css">site.css</a> file and now the application shows up as a tiny thumbnail on my iPhone. Just tap on the app and iPhone will automatically zoom it.</li>
</ul>
</blockquote>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/note19.wordpress.com/233/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/note19.wordpress.com/233/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/note19.wordpress.com/233/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/note19.wordpress.com/233/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/note19.wordpress.com/233/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/note19.wordpress.com/233/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/note19.wordpress.com/233/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/note19.wordpress.com/233/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/note19.wordpress.com/233/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/note19.wordpress.com/233/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/note19.wordpress.com/233/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/note19.wordpress.com/233/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/note19.wordpress.com/233/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/note19.wordpress.com/233/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/note19.wordpress.com/233/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/note19.wordpress.com/233/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=note19.com&amp;blog=1100651&amp;post=233&amp;subd=note19&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://note19.com/2007/10/02/adobe-share-on-your-iphone/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/f6955c88abe26707bceccc55642e7e58?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Shahram</media:title>
		</media:content>

		<media:content url="http://note19.files.wordpress.com/2007/10/adobeshare.thumbnail.png" medium="image">
			<media:title type="html">Adobe SHARE</media:title>
		</media:content>

		<media:content url="http://note19.files.wordpress.com/2007/10/share.thumbnail.png" medium="image">
			<media:title type="html">Share PDF</media:title>
		</media:content>

		<media:content url="http://www.assoc-amazon.com/e/ir?t=httpjaveynet-20&#38;l=ur2&#38;o=1" medium="image" />
	</item>
		<item>
		<title>Charting tools</title>
		<link>http://note19.com/2007/07/19/charting-tools/</link>
		<comments>http://note19.com/2007/07/19/charting-tools/#comments</comments>
		<pubDate>Thu, 19 Jul 2007 05:01:20 +0000</pubDate>
		<dc:creator>Shahram Javey</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Ruby on Rails]]></category>

		<guid isPermaLink="false">http://note19.com/2007/07/19/charting-tools/</guid>
		<description><![CDATA[I was looking at creating a chart in Ruby so I started looking at charting libraries. I like the features of dojo, but the dojo documentation is kind of sparse and each quest for information ends up taking too long. Then came along the Flash charing tools of maani.us. It is in Flash (which at [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=note19.com&amp;blog=1100651&amp;post=182&amp;subd=note19&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://javey.net/sample/history.html" title="Charting in Flash"><img src="http://note19.files.wordpress.com/2007/07/longitude1.png?w=140" class="alignleft" alt="Charting in Flash" width="140" /></a>I was looking at creating a chart in Ruby so I started looking at charting libraries. I like the features of <a href="http://note19.com/2007/02/07/dojo-javascript-library/">dojo</a>, but the dojo documentation is kind of sparse and each quest for information ends up taking too long. Then came along the Flash charing tools of <a href="http://www.maani.us">maani.us</a>. It is in Flash (which at least for now means that you wont be able to use it for iPhone). The design of the maani.us is outstanding (it requires Flash 6 or above). Easy charts are quite easy to create, but hard things may be quite difficult to accomplish. For example, I want to create a timeline graph and would like to have a horizontal scrollbar. This is not possible directly in maani.us. I suppose it is possible to embed maani.us in a flash application. I&#8217;m still not sure which approach I prefer: Flash based or JavaScript based.</p>
<blockquote><p> You need to create an XML file to describe your chart. I created the sample maani.us chart using this <a href="http://javey.net/sample/history.xml">XML</a> file. Here is the ruby <a href="http://note19.googlecode.com/svn/trunk/longitude/history.rb">program</a> that created this XML.</p></blockquote>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/note19.wordpress.com/182/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/note19.wordpress.com/182/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/note19.wordpress.com/182/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/note19.wordpress.com/182/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/note19.wordpress.com/182/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/note19.wordpress.com/182/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/note19.wordpress.com/182/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/note19.wordpress.com/182/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/note19.wordpress.com/182/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/note19.wordpress.com/182/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/note19.wordpress.com/182/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/note19.wordpress.com/182/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/note19.wordpress.com/182/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/note19.wordpress.com/182/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/note19.wordpress.com/182/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/note19.wordpress.com/182/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=note19.com&amp;blog=1100651&amp;post=182&amp;subd=note19&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://note19.com/2007/07/19/charting-tools/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/f6955c88abe26707bceccc55642e7e58?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Shahram</media:title>
		</media:content>

		<media:content url="http://note19.files.wordpress.com/2007/07/longitude1.png" medium="image">
			<media:title type="html">Charting in Flash</media:title>
		</media:content>
	</item>
		<item>
		<title>Alternating Colors in Ruby/Rails</title>
		<link>http://note19.com/2007/05/31/alternating-colors-in-rubyrails/</link>
		<comments>http://note19.com/2007/05/31/alternating-colors-in-rubyrails/#comments</comments>
		<pubDate>Thu, 31 May 2007 02:12:45 +0000</pubDate>
		<dc:creator>Shahram Javey</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Ruby on Rails]]></category>

		<guid isPermaLink="false">http://note19.com/2007/05/31/alternating-colors-in-rubyrails/</guid>
		<description><![CDATA[For displaying lists it is often useful to show the rows of the list in alternating colors. Ruby on Rails makes this really easy. Define the background colors using HTML style tag. &#60;head&#62; &#60;style&#62; .even { background: #99ccff; } .odd { background: #cccccc; } &#60;/style&#62; &#60;/head&#62; Add the class attribute that calls the cycle method [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=note19.com&amp;blog=1100651&amp;post=134&amp;subd=note19&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><img src="http://note19.files.wordpress.com/2007/05/ruutes.thumbnail.png?w=450" alt="Alternate Colors" class="alignleft" /> For displaying lists it is often useful to show the rows of the list in alternating colors. Ruby on Rails makes this really easy.</p>
<ol>
<li>Define the background  colors using HTML style tag.</li>
<p><code> &lt;head&gt;<br />
&lt;style&gt;<br />
<font color="red"><strong>.even { background: #99ccff; }<br />
.odd { background: #cccccc; }</strong></font><br />
&lt;/style&gt;<br />
&lt;/head&gt;<br />
</code></p>
<li>Add the class attribute that calls the <code>cycle</code> method to the HTML element that you use to describe the row, e.g., <code>DIV</code> or table row <code>TR</code>, &#8230;, for example:<br />
<code><br />
&lt;% for track in @tracks %&gt;<br />
&lt;div <font color="red"><strong>class="&lt;%= cycle('even','odd') %&gt;" </strong></font>&gt;<br />
&lt;h3&gt; 'show', :id =&gt; track %&gt;&lt;/h3&gt;<br />
&lt;/div&gt;<br />
&lt;% end %&gt;</code></li>
</ol>
<p>That is it. Kudos to Ruby on Rails creators for making this so simple!</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/note19.wordpress.com/134/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/note19.wordpress.com/134/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/note19.wordpress.com/134/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/note19.wordpress.com/134/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/note19.wordpress.com/134/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/note19.wordpress.com/134/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/note19.wordpress.com/134/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/note19.wordpress.com/134/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/note19.wordpress.com/134/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/note19.wordpress.com/134/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/note19.wordpress.com/134/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/note19.wordpress.com/134/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/note19.wordpress.com/134/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/note19.wordpress.com/134/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/note19.wordpress.com/134/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/note19.wordpress.com/134/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=note19.com&amp;blog=1100651&amp;post=134&amp;subd=note19&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://note19.com/2007/05/31/alternating-colors-in-rubyrails/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/f6955c88abe26707bceccc55642e7e58?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Shahram</media:title>
		</media:content>

		<media:content url="http://note19.files.wordpress.com/2007/05/ruutes.thumbnail.png" medium="image">
			<media:title type="html">Alternate Colors</media:title>
		</media:content>
	</item>
		<item>
		<title>Updating Ruby &amp; Rails on OS X</title>
		<link>http://note19.com/2007/05/28/updating-ruby-rails-on-os-x/</link>
		<comments>http://note19.com/2007/05/28/updating-ruby-rails-on-os-x/#comments</comments>
		<pubDate>Mon, 28 May 2007 17:21:23 +0000</pubDate>
		<dc:creator>Shahram Javey</dc:creator>
				<category><![CDATA[OS X]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Ruby on Rails]]></category>

		<guid isPermaLink="false">http://note19.com/2007/05/28/updating-ruby-rails-on-os-x/</guid>
		<description><![CDATA[The 10.4.9 version of OS X includes ruby 1.8.1-1, and readline 5.0. The latest version of ruby is 1.8.6. You can follow the excellent instructions on maconrails.com I had to make a few minor adjustments to get it to work on my system. Install xcode for C development. At least you&#8217;ll need to install these [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=note19.com&amp;blog=1100651&amp;post=131&amp;subd=note19&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>The 10.4.9 version of OS X includes ruby 1.8.1-1, and readline 5.0. The latest version of ruby is 1.8.6.  You  can follow the excellent instructions  on <a href="http://maconrails.com/">maconrails.com</a> I had to make a few minor adjustments to get it to work on my system.</p>
<ol>
<li>Install xcode for C development. At least you&#8217;ll need to install these packages:  <code>gcc4.0.pkg</code>, <code>DevSDK.pkg</code>, <code>BSDSDK.pkg</code>, and <code>X11SDK.pkg</code></li>
<li>The <code>readline</code> that is included in OS X is recent enough.</li>
<li>Create .bash_profile file and modify the PATH environment variable.<br />
<code> </code></p>
<pre>
export
PATH="/usr/local/bin:/usr/local/mysql/bin:/usr/local/sbin:$PATH"</pre>
</li>
<li>Get the latest version of Ruby and Gem. Copy their folders into <code>/usr/local/src</code>. Now build &amp; install it on your system:<br />
<code><br />
<font color="gray">$</font> cd /usr/local/src/ruby-1.8.6<br />
<font color="gray">$</font> source ~/.bash_profile<br />
<font color="gray">$</font> ./configure --prefix=/usr/local --enable-pthread<br />
<font color="gray">$</font> make<br />
<font color="gray">$</font> sudo make install<br />
<font color="gray">$</font> sudo make install-doc<br />
<font color="gray">$</font> cd ../rubygems-0.9.4<br />
<font color="gray">$</font> sudo ruby setup.rb<br />
<font color="gray">$</font> sudo gem update --system<br />
<font color="gray">$</font> sudo gem install rails --include-dependencies</code></li>
</ol>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/note19.wordpress.com/131/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/note19.wordpress.com/131/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/note19.wordpress.com/131/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/note19.wordpress.com/131/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/note19.wordpress.com/131/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/note19.wordpress.com/131/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/note19.wordpress.com/131/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/note19.wordpress.com/131/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/note19.wordpress.com/131/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/note19.wordpress.com/131/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/note19.wordpress.com/131/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/note19.wordpress.com/131/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/note19.wordpress.com/131/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/note19.wordpress.com/131/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/note19.wordpress.com/131/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/note19.wordpress.com/131/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=note19.com&amp;blog=1100651&amp;post=131&amp;subd=note19&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://note19.com/2007/05/28/updating-ruby-rails-on-os-x/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/f6955c88abe26707bceccc55642e7e58?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Shahram</media:title>
		</media:content>
	</item>
		<item>
		<title>Ruby on Rails on OS X</title>
		<link>http://note19.com/2007/05/27/ruby-on-rails-on-os-x/</link>
		<comments>http://note19.com/2007/05/27/ruby-on-rails-on-os-x/#comments</comments>
		<pubDate>Sun, 27 May 2007 03:03:21 +0000</pubDate>
		<dc:creator>Shahram Javey</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Ruby on Rails]]></category>

		<guid isPermaLink="false">http://note19.com/2007/05/27/ruby-on-rails-on-os-x/</guid>
		<description><![CDATA[There are a number of ways to make sure that you&#8217;ve what you need to start Ruby on Rails development on OS X. The easiest way is buy a copy of TextMate and install Locomotive (this is all in one Ruby, Rails, Web server bundle). ActiveState sells a full blown IDE (Komodo) with proper debugging [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=note19.com&amp;blog=1100651&amp;post=123&amp;subd=note19&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://note19.files.wordpress.com/2007/05/loco.png" title="Locomotive, TextMate"><img src="http://note19.files.wordpress.com/2007/05/loco.png?w=120" class="alignleft" alt="Locomotive, TextMate" width="120" /></a>There are a number of ways to make sure that you&#8217;ve what you need to start Ruby on Rails development on OS X. The easiest way is buy a copy of <a href="http://macromates.com/">TextMate</a> and install <a href="http://locomotive.raaum.org/">Locomotive</a> (this is all in one Ruby, Rails, Web server bundle). ActiveState sells a full blown IDE (<a href="http://www.activestate.com/products/komodo_ide/">Komodo</a>) with proper debugging support for Ruby. But you need to make sure that you installed rails, &#8230; before you can use it.</p>
<p>The 1st application I tried was file <a href="http://sean.treadway.info/demo/upload/">upload</a>. Looks like Locomotive&#8217;s rails does not understand <code>form_tag_with_upload_progress</code> and this specific <a href="http://ap.rubyonrails.com/classes/ActionView/Helpers/UploadProgressHelper.html">feature</a>   will require the latest ruby/rails. So now I&#8217;ll have to figure out how to update Ruby/Rails on the Mac. <a href="http://finkcommander.sourceforge.net/">FinkCommander</a> here I come.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/note19.wordpress.com/123/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/note19.wordpress.com/123/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/note19.wordpress.com/123/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/note19.wordpress.com/123/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/note19.wordpress.com/123/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/note19.wordpress.com/123/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/note19.wordpress.com/123/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/note19.wordpress.com/123/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/note19.wordpress.com/123/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/note19.wordpress.com/123/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/note19.wordpress.com/123/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/note19.wordpress.com/123/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/note19.wordpress.com/123/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/note19.wordpress.com/123/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/note19.wordpress.com/123/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/note19.wordpress.com/123/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=note19.com&amp;blog=1100651&amp;post=123&amp;subd=note19&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://note19.com/2007/05/27/ruby-on-rails-on-os-x/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/f6955c88abe26707bceccc55642e7e58?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Shahram</media:title>
		</media:content>

		<media:content url="http://note19.files.wordpress.com/2007/05/loco.png" medium="image">
			<media:title type="html">Locomotive, TextMate</media:title>
		</media:content>
	</item>
		<item>
		<title>Ruby bit rot</title>
		<link>http://note19.com/2007/04/18/ruby-bit-rot/</link>
		<comments>http://note19.com/2007/04/18/ruby-bit-rot/#comments</comments>
		<pubDate>Wed, 18 Apr 2007 04:19:39 +0000</pubDate>
		<dc:creator>Shahram Javey</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Ruby on Rails]]></category>

		<guid isPermaLink="false">http://note19.wordpress.com/2007/04/18/ruby-bit-rot/</guid>
		<description><![CDATA[Today I was looking at an earlier test Ruby program that I had written to explore photos on Flickr. I noticed that the program had stopped working and I saw the following error in the log files: Cannot find gem for Rails =1.1.6: Install the missing gem with 'gem install -v=1.1.6 rails', or change environment.rb [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=note19.com&amp;blog=1100651&amp;post=70&amp;subd=note19&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Today I was looking at an earlier test Ruby <a href="http://javey.wordpress.com/2007/01/14/ruby-flickr-100-module-bug-fix/">program </a>that I had written to explore photos on Flickr. I noticed that the program had stopped working and I saw the following error in the log files:</p>
<p><code>Cannot find gem for Rails =1.1.6: Install the missing gem with 'gem install -v=1.1.6 rails', or change environment.rb to define RAILS_GEM_VERSION with your desired version.</code></p>
<p>The hosting company that I use updated rails to version 1.2.3 and the rails version that I was using was 1.1.6. I had to edit the file <code>.../config/environment.rb</code> and updated the statement <code>RAILS_GEM_VERSION = '1.2.3'</code> and the <a href="http://flickr.javey.net/flickr">program </a>started to work again. Now days it is virtually impossible to write a program that could continue to work over time as the underlying OS, platform, &#8230; is revved up.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/note19.wordpress.com/70/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/note19.wordpress.com/70/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/note19.wordpress.com/70/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/note19.wordpress.com/70/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/note19.wordpress.com/70/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/note19.wordpress.com/70/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/note19.wordpress.com/70/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/note19.wordpress.com/70/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/note19.wordpress.com/70/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/note19.wordpress.com/70/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/note19.wordpress.com/70/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/note19.wordpress.com/70/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/note19.wordpress.com/70/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/note19.wordpress.com/70/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/note19.wordpress.com/70/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/note19.wordpress.com/70/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=note19.com&amp;blog=1100651&amp;post=70&amp;subd=note19&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://note19.com/2007/04/18/ruby-bit-rot/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/f6955c88abe26707bceccc55642e7e58?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Shahram</media:title>
		</media:content>
	</item>
		<item>
		<title>Rails web application creation steps</title>
		<link>http://note19.com/2007/01/16/rails-application-steps/</link>
		<comments>http://note19.com/2007/01/16/rails-application-steps/#comments</comments>
		<pubDate>Tue, 16 Jan 2007 22:51:28 +0000</pubDate>
		<dc:creator>Shahram Javey</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Ruby on Rails]]></category>

		<guid isPermaLink="false">http://note19.wordpress.com/2007/01/16/rails-application-steps/</guid>
		<description><![CDATA[The Rails framework is an efficient tool for producing web applications using the Ruby language. Here are steps to create a database backed web application. Here are the steps to create a sample application that provides access to a sample UPC database of grocery items. The database was provided as an spreadsheet. Each row of [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=note19.com&amp;blog=1100651&amp;post=25&amp;subd=note19&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>The <a href="http://www.rubyonrails.org/api/">Rails</a> framework is an efficient tool for producing web applications using the Ruby language. Here are steps to create a database backed web application. Here are the steps to create a sample application that provides access to a sample UPC database of grocery items. The database was provided as an spreadsheet. Each row of the spreadsheet corresponds to an item and each item has over 80 properties. In this sample, I&#8217;ll create a rails  application that allows the user to view, find and edit the grocery database.<span id="more-25"></span></p>
<ol>
<li>Create the application folder: <code>$rails <em>upc</em></code>  and then change to this directory.</li>
<li>Modify the file <code>./config/database.yml</code> and add the username/password for your development, test and production databases.</li>
<li>Generate the model. Here we only have one table (a list of grocery items). The class Item corresponds to one row of this database.<code>$ruby ./script/generate model<em> Item</em></code>Use Rails&#8217;s schema <a href="http://www.rubyonrails.org/api/classes/ActiveRecord/Migration.html">migration</a> to create the database. Schema migration is a database independent way of creating a database schema. By default Rails (1.1 and above) uses Active Record instead of SQL scripts.</li>
<li>Configure the database by editing the file<br />
<code>./db/migrate/001_create_items.rb</code><br />
and modify the <code>up</code> method to  include all of the columns of your database table, e.g.  look like this:<code><br />
class CreateItems &lt; ActiveRecord::Migration<br />
def self.up<br />
create_table :items do |t|<br />
# add all columns of your database table, here is a sample<br />
t.column "status", :string<br />
t.column "date", :date<br />
t.column "upc-e", :string<br />
t.column "ucc-12", :string<br />
end<br />
end<br />
def self.down<br />
drop_table :items<br />
end<br />
end</code></li>
<li>Run the <code>rake</code> command to create (&amp; upgrade?) the database tables (you&#8217;ll need to create the database (production, development, and test databases) before hand, e.g., log-in to MySQL and create <code>upc_development</code> database before you run the <code>rake</code> command):<br />
<code>rake migrate</code></li>
<li>Now that the database has been setup, its time to initialize the database. You can do this by creating a <a href="http://ar.rubyonrails.org/classes/Fixtures.html">fixture</a>. It helps if you already have your data in the form of a CSV file. Simply copy one CSV file for each database table (if the name of the table is <code>items</code>, then the name the CSV file <code>items.csv</code>). Copy the CSV file to the <code>./test/fixtures</code> folder. Use the <code>rake</code> command to load the CSV file:<br />
<code>rake db:fixtures:load</code><br />
If the columns in the CSV are blank, then loading in MySQL will fail with error such as Data truncated for a specific column. You can edit the CSV file and replace these blanks with suitable initial values (there must be an easier way)</li>
<li>Once the database has been initialized, you can use the  rails console application to dynamically explore the mode (view and edit). Here is how you can start the console app:<br />
<code><br />
$ruby script/console -s<br />
Loading development environment in sandbox<br />
Any modifications you make will be rolled back on exit.<br />
&gt;&gt; a = Item.find(3)<br />
=&gt; ...<br />
&gt;&gt; y a<br />
=&gt; ...<br />
</code>This will load the database in sandbox mode, assign variable <code>a</code> to the 3rd row of the table and then list all the columns of this row.</li>
<li>Create the Controllers&#8230;. TBD</li>
<li>Create the Views&#8230;TBD</li>
<li>Start the server, and visit the application&#8230;.TBD</li>
</ol>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/note19.wordpress.com/25/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/note19.wordpress.com/25/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/note19.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/note19.wordpress.com/25/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/note19.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/note19.wordpress.com/25/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/note19.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/note19.wordpress.com/25/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/note19.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/note19.wordpress.com/25/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/note19.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/note19.wordpress.com/25/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/note19.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/note19.wordpress.com/25/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/note19.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/note19.wordpress.com/25/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=note19.com&amp;blog=1100651&amp;post=25&amp;subd=note19&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://note19.com/2007/01/16/rails-application-steps/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/f6955c88abe26707bceccc55642e7e58?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Shahram</media:title>
		</media:content>
	</item>
	</channel>
</rss>
