<?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>Wyatt Baldwin &#187; ruby on rails</title>
	<atom:link href="http://wyattbaldwin.com/tag/ruby-on-rails/feed/" rel="self" type="application/rss+xml" />
	<link>http://wyattbaldwin.com</link>
	<description></description>
	<lastBuildDate>Tue, 20 Jul 2010 17:43:25 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>YUI TreeView with Ruby on Rails</title>
		<link>http://wyattbaldwin.com/2008/05/26/yui-treeview-with-ruby-on-rails/</link>
		<comments>http://wyattbaldwin.com/2008/05/26/yui-treeview-with-ruby-on-rails/#comments</comments>
		<pubDate>Tue, 27 May 2008 03:48:07 +0000</pubDate>
		<dc:creator>Wyatt</dc:creator>
				<category><![CDATA[dev]]></category>
		<category><![CDATA[acts_as_tree]]></category>
		<category><![CDATA[recursion]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[ruby on rails]]></category>
		<category><![CDATA[yui]]></category>

		<guid isPermaLink="false">http://wyattbaldwin.com/?p=184</guid>
		<description><![CDATA[Here&#8217;s some code I&#8217;m using to generate a dynamic tree view using an acts_as_tree model with slug and title fields, the TreeView widget from YUI, and a Rails helper. I chopped out some of the code for clarity, so all &#8230; <a href="http://wyattbaldwin.com/2008/05/26/yui-treeview-with-ruby-on-rails/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s some code I&#8217;m using to generate a dynamic tree view using an acts_as_tree model with slug and title fields, the TreeView widget from YUI, and a Rails helper. I chopped out some of the code for clarity, so all this does is create a menu with the titles from the model, but the basic idea is there to expand on.</p>
<p><strong>Rails view/JavaScript</strong></p>
<pre>&lt;script type="text/javascript"&gt;
  var page_tree;
  page_tree_init = function () {
    page_tree = new YAHOO.widget.TreeView('page_tree');
    var root = page_tree.getRoot();
    &lt;% generate_page_nodes(@root) {} %&gt;
    page_tree.draw();
  };
  page_tree_init();
&lt;/script&gt;
</pre>
<p><strong>Ruby</strong></p>
<pre>def generate_page_nodes(node, &amp;block)
  parent = node.parent
  node_name = node.slug.gsub('-', '_')
  parent_node_name = parent.nil? ? 'root' : parent.slug.gsub('-', '_')
  js = &lt;&lt;-JS
    var #{node_name} = new YAHOO.widget.MenuNode('&lt;span class="node_title"&gt;#{node.title}&lt;/span&gt;',
                                                 #{parent_node_name});
  JS
  concat(js, block.binding)
  children = node.children
  children.each { |c| generate_page_nodes(c, &amp;block) } unless children.empty?
end
</pre>
]]></content:encoded>
			<wfw:commentRss>http://wyattbaldwin.com/2008/05/26/yui-treeview-with-ruby-on-rails/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Ruby on Rails&#8230; Revisited</title>
		<link>http://wyattbaldwin.com/2008/04/04/ruby-on-rails-revisited/</link>
		<comments>http://wyattbaldwin.com/2008/04/04/ruby-on-rails-revisited/#comments</comments>
		<pubDate>Sat, 05 Apr 2008 03:54:56 +0000</pubDate>
		<dc:creator>Wyatt</dc:creator>
				<category><![CDATA[dev]]></category>
		<category><![CDATA[planet python]]></category>
		<category><![CDATA[comparisons]]></category>
		<category><![CDATA[django]]></category>
		<category><![CDATA[grok]]></category>
		<category><![CDATA[pylons]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[ruby on rails]]></category>
		<category><![CDATA[web]]></category>
		<category><![CDATA[web frameworks]]></category>
		<category><![CDATA[zope 3]]></category>

		<guid isPermaLink="false">http://wyattbaldwin.com/?p=130</guid>
		<description><![CDATA[Updated with links and a couple typo corrections. I&#8217;ve been working on a fairly big Web site project lately. My partner and I initially decided to use Django to build the site, mainly because I&#8217;m a Python &#8220;expert&#8221; and Django &#8230; <a href="http://wyattbaldwin.com/2008/04/04/ruby-on-rails-revisited/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><em>Updated with links and a couple typo corrections.</em></p>
<p>I&#8217;ve been working on a fairly big Web site project lately. My partner and I initially decided to use <a title="Django Python Web Framework" href="http://www.djangoproject.com/">Django</a> to build the site, mainly because I&#8217;m a <a title="Python programming language" href="http://python.org/">Python</a> &#8220;expert&#8221; and Django is (apparently) the #1 Python Web framework. We were also lured by the easy admin interface.</p>
<p>After trying to use Django and not really enjoying it, I tried switching to <a title="Pylons Python Web Framework" href="http://pylonshq.com/">Pylons</a> because I&#8217;ve had a good amount of experience with it in the building of <a title="byCycle bicycle trip planner / route finder" href="http://bycycle.org/">byCycle.org</a>. It&#8217;s gone through two fairly major releases since then, and so have a bunch of the libraries that tend to get used with it, like <a title="SQLAlchemy Python database library" href="http://sqlalchemy.org/">SQLAlchemy</a>, <a title="Elixir Python Active Record library" href="http://elixir.ematia.de/trac/wiki">Elixir</a>, etc.</p>
<p>I was having a hard time with the Pylons docs, and so I ended screwing around with <a title="Grok Python Web framework" href="http://grok.zope.org/">Grok</a> (which actually looks fairly interesting) and even took a look at the <a title="Zope 3 Python Web framework" href="http://wiki.zope.org/zope3/Zope3Wiki">Zope 3</a> site. I&#8217;m sure Zope is really awesome or whatever, but it might as well suck. Every time I look at that site, I&#8217;m just like &#8220;WTF! This shit has been around for like five years!&#8221; Anyway, I might just not be smart enough for Zope.</p>
<p>This led us back toward <a title="Ruby on Rails Web framework" href="http://rubyonrails.org/">Rails</a> (even if <a title="Rails is a ghetto?" href="http://www.zedshaw.com/rants/rails_is_a_ghetto.html">it is a ghetto</a>). I used Rails a bit last year but never did anything too serious with it. Diving into it today was quite a pleasure. There are issues to be sure, but overall I&#8217;m enjoying it <em>by far</em> over any of the other options we had tried. I&#8217;m also enjoying learning/relearning <a title="Ruby programming language" href="http://www.ruby-lang.org/">Ruby</a>.</p>
<p>If Pylons had good docs, we&#8217;d probably be using that.</p>
<p>So, I don&#8217;t know if this is a particularly useful post, since I didn&#8217;t get into much in the way of reasons (what, i have back this up?!). This subject&#8217;s been hashed and rehashed, but I just wanted (<em>needed</em>) to make a qualitative statement about my/our experience, which, of course, is purely personal.</p>
]]></content:encoded>
			<wfw:commentRss>http://wyattbaldwin.com/2008/04/04/ruby-on-rails-revisited/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>Ruby on Rails and Opinions on Opinionated Web Frameworks</title>
		<link>http://wyattbaldwin.com/2006/10/15/ruby-on-rails-and-opinions-on-opinionated-web-frameworks/</link>
		<comments>http://wyattbaldwin.com/2006/10/15/ruby-on-rails-and-opinions-on-opinionated-web-frameworks/#comments</comments>
		<pubDate>Sun, 15 Oct 2006 14:16:15 +0000</pubDate>
		<dc:creator>Wyatt</dc:creator>
				<category><![CDATA[dev]]></category>
		<category><![CDATA[pylons]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[ruby on rails]]></category>
		<category><![CDATA[web frameworks]]></category>

		<guid isPermaLink="false">http://wyattbaldwin.com/2006/10/16/ruby-on-rails-and-opinions-on-opinionated-web-frameworks/</guid>
		<description><![CDATA[I originally started this over on the byCycle blog [which is currently offline--3/20/08], but it doesn’t really belong there, so I moved it over here on 1/3/2007. It’s not finished, but I think it may contain some useful info, so &#8230; <a href="http://wyattbaldwin.com/2006/10/15/ruby-on-rails-and-opinions-on-opinionated-web-frameworks/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><em>I originally started this over on the <a href="http://bycycle.org/blog">byCycle blog</a> [which is currently offline--3/20/08], but it doesn’t really belong there, so I moved it over here on 1/3/2007. It’s not finished, but I think it may contain some useful info, so here it is…</em></p>
<h3>Introduction</h3>
<p>In this post I’m going to discuss my first real foray into the world of Ruby and Ruby on Rails (AKA Rails). I’m also going to talk about how my initial experience with Ruby and Rails has differed from my recent and ongoing experience with Pylons, a similar-to-Rails Python framework.</p>
<h3>Background</h3>
<p>Recently, mostly by chance, I came across a job posting on craigslist by a local startup looking for a Ruby on Rails developer. I’m not actively looking for a job, but I guess I was “bored” or something and was curious what the jobs landscape in Portland is looking like these days.</p>
<p>A (long) while back when I was looking at CL more regularly, it seemed like all the jobs were Java or <span class="caps">PHP</span> related and required five years of experience (yes, I’m generalizing). Now I’m not gonna say I “hate” Java or <span class="caps">PHP</span>, but the end result is about the same. On the other hand, this job looks very interesting, and I’m even preparing a cover letter and resume for it.</p>
<p>Since getting into Python about two years ago, I’ve heard of Ruby and even tinkered with it some. And since we’re developing a <a href="http://tripplanner.bycycle.org/" title="byCycle Bicycle Trip Planner">Web application</a>, I’ve definitely heard of Ruby on Rails. Several months back, I created a Rails project and poked around in it some (i.e., typed ‘rails project_name’ then ’./script/server’) but didn’t really do anything with it.</p>
<p>There seems to be a little strain between the Python and Ruby communities, especially on the Web framework front, but the consensus seems to be that the two languages are more similar than different. My recent experience has been with Python Web frameworks similar to Rails, especially Pylons.</p>
<p>From past experience learning new languages, and particularly because of their similarities, I don’t think I would have any trouble transitioning from Python/Pylons to Ruby/Rails. Just to make sure, though, I figured I should do at least a small project using Rails. I haven’t done anything with my personal site in a long time and it’s fairly simple, so I decided to give it a Rails makeover.</p>
<h3>Initial Impressions</h3>
<ul>
<li>Ruby: +1</li>
<li>Wacky Interactive tutorial and book: +1 [Why’s]</li>
<li>Rails: +1</li>
<li>Rails support and community: +1</li>
<li>Opinionated frameworks: +1</li>
<li>RadRails Eclipse-based <span class="caps">IDE</span>: +1</li>
<li>Emacs as Rails <span class="caps">IDE</span>: -1</li>
<li><span class="caps">VIM</span> (actually cream) as Rails <span class="caps">IDE</span>: -1</li>
</ul>
<h3>First Steps</h3>
<p>One of the first things I did was to check out the official Ruby site. What I especially liked there was the interactive tutorial, which embeds a Ruby console in a Web page. Even non-programmers would be able to follow this, and I recommend giving it a try. If you’re a seasoned programmer, the tutorial is pretty lightweight, but it does serve as a good introduction to Ruby if you’ve never really done anything with it.</p>
<h3><span class="caps">IDE</span></h3>
<p>I’m using Ubuntu, and I first started working on the project in Emacs. Emacs is a good editor and is what I have historically used for all kinds of files, but I’m finding that it kind of sucks (at least for me) for this type of thing, even after installing all the whiz-bang Ruby/Rails modes and whatnot.</p>
<p>One thing I really like is an easy way to navigate all the project files. I like document tabs and tree views and that sort of thing. I tried various ways of getting those things in Emacs and <span class="caps">VIM</span>, but it just seems clunky, and doesn’t have all the pretty little icons and stuff.</p>
<p>Internet research turned up a few other contenders. A few people seem to be happy with JEdit and claim it can be set up to be very similar to TextMate on Mac <span class="caps">OS X</span>. I wouldn’t know because I haven’t used TextMate extensively and I haven’t installed JEdit yet (and I might not).</p>
<p>I already had Eclipse installed from an earlier attempt at using PyDev. I never used it much because it was too damn slow. Important: This time around I am using Sun’s <span class="caps">JVM</span> [<em>now GPLed, w00t!</em>] instead of the one that comes with Ubuntu, and this makes a huge difference: I’m actually able to use it!</p>
<p>So far, it does seem pretty rad indeed [<em>with the Eclipse RadRails plugin</em>]. One gotcha so far: it requires setting a host, port, and password in database.yml, even if you don’t need this from the command line. Something to do with <span class="caps">ODBC</span> or <span class="caps">JDBC</span> or whatever Eclipse/Java uses to connect to databases.</p>
<h3>Database Issues</h3>
<p><em>I don’t remember what I thought the issues were way back when. It turned out that the FreeBSD 6.1 jail (VPS) I was trying to deploy to had some issue with Postgres and semaphores and ports and other users and some such (yada yada), and Postgres would continuously barf (randomly, sometimes staying up for days, sometimes hours). The hosting company was no help, I couldn’t find much info via The Google, and it just wasn’t worth the trouble at the time, so I gave up and dumped the company.</em></p>
]]></content:encoded>
			<wfw:commentRss>http://wyattbaldwin.com/2006/10/15/ruby-on-rails-and-opinions-on-opinionated-web-frameworks/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
