<?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>A Few Thoughts... &#187; Ruby and Rails</title>
	<atom:link href="http://blog.rocklinfamily.com/category/technology/ruby-and-rails/feed" rel="self" type="application/rss+xml" />
	<link>http://blog.rocklinfamily.com</link>
	<description></description>
	<lastBuildDate>Wed, 21 Apr 2010 14:25:05 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Try Ruby!</title>
		<link>http://blog.rocklinfamily.com/technology/try-ruby</link>
		<comments>http://blog.rocklinfamily.com/technology/try-ruby#comments</comments>
		<pubDate>Wed, 14 Dec 2005 14:21:58 +0000</pubDate>
		<dc:creator>Joe Rocklin</dc:creator>
				<category><![CDATA[Ruby and Rails]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://blog.rocklinfamily.com/?p=37</guid>
		<description><![CDATA[A guy got really creative with his ruby programming skills, and developed the Try Ruby website.  You can go and walk through some tutorials which take all of ten minutes or so.  And the interface is pretty cool too!
Unfortuantely, the project I wanted to do here at work with RoR is being pushed [...]]]></description>
			<content:encoded><![CDATA[<p>A guy got really creative with his ruby programming skills, and developed the <a href="http://tryruby.hobix.com/">Try Ruby</a> website.  You can go and walk through some tutorials which take all of ten minutes or so.  And the interface is pretty cool too!</p>
<p>Unfortuantely, the project I wanted to do here at work with RoR is being pushed over to PHP, which I&#8217;m not too happy about.  I think from an extensibility point RoR would be much more promising (and they <a href="http://www.rubyonrails.org/">just went 1.0</a> with RoR btw&#8230;).  Maybe I&#8217;ll start looking into <a href="http://www.symfony-project.com/">symfony</a>, the PHP equivalent of the RoR framework&#8230; </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.rocklinfamily.com/technology/try-ruby/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Rails Notes &#8211; Database named &#8216;logs&#8217;</title>
		<link>http://blog.rocklinfamily.com/technology/rails-notes-database-named-logs</link>
		<comments>http://blog.rocklinfamily.com/technology/rails-notes-database-named-logs#comments</comments>
		<pubDate>Thu, 20 Oct 2005 20:34:35 +0000</pubDate>
		<dc:creator>Joe Rocklin</dc:creator>
				<category><![CDATA[Ruby and Rails]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://blog.rocklinfamily.com/?p=10</guid>
		<description><![CDATA[So, as I&#8217;ve been playing with Ruby on Rails (henceforth RoR or just rails), I have come across some issues which seem to be interesting, not obvious, and all together well documented. First and foremost :Don&#8217;t name a database &#8216;logs&#8217; and expect things to work! It took me a few hours trying to decode what [...]]]></description>
			<content:encoded><![CDATA[<p>So, as I&#8217;ve been playing with Ruby on Rails (henceforth RoR or just rails), I have come across some issues which seem to be interesting, not obvious, and all together well documented. First and foremost :<strong>Don&#8217;t name a database &#8216;logs&#8217; and expect things to work!</strong> It took me a few hours trying to decode what scaffold was really doing when it gave the error akin to &#8220;no method &#8216;count&#8217; for logs controller.&#8221; Best I can understand, [Ll]og[s]? is a reserved term of sorts within rails and should not be messed with. I changed the database name, recreated the model and controller and it all worked like magic.  So, in order for others to avoid such issues, I&#8217;m posting this on the web for all to see!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.rocklinfamily.com/technology/rails-notes-database-named-logs/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Thoughts on Ruby</title>
		<link>http://blog.rocklinfamily.com/technology/thoughts-on-ruby</link>
		<comments>http://blog.rocklinfamily.com/technology/thoughts-on-ruby#comments</comments>
		<pubDate>Tue, 18 Oct 2005 12:49:18 +0000</pubDate>
		<dc:creator>Joe Rocklin</dc:creator>
				<category><![CDATA[Ruby and Rails]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://blog.rocklinfamily.com/?p=7</guid>
		<description><![CDATA[So I&#8217;ve been playing around with Ruby on Rails a bit recently.  It seems like the presentation of the language is much nicer than I remember it.  I looked at Ruby a while back when I was working on a project for Lunar Linux &#8211; but it never panned out.  The Rails [...]]]></description>
			<content:encoded><![CDATA[<p>So I&#8217;ve been playing around with Ruby on Rails a bit recently.  It seems like the presentation of the language is much nicer than I remember it.  I looked at Ruby a while back when I was working on a project for Lunar Linux &#8211; but it never panned out.  The Rails framework is quite slick &#8211; it does a lot of the startup work for you, and lets you go modify and update things as you can get to them.  I started on a ruby tutorial, but like any programmer quickly found myself asking questions that the tutorial didn&#8217;t cover, and so decided to start off on my own little quick project.<br />
<span id="more-7"></span><br />
Enter RubyWiki 0.0.1.  Okay, so maybe I went a little overboard giving it a version number as it will never see the light of day after this experiment (MediaWiki is just too nice).  Anyway, within an hour or so I had almost all of the necessary basics for a Wiki &#8211; Pages that you could create, show, and edit.  You can put links into the pages, but I don&#8217;t have any markup (other than html) for doing so yet &#8211; that is the task at hand for today.  </p>
<p>But before I could start on that, I needed to learn about how ruby handles regular expressions!  Being a perl hacker, I keep regular expressions closer than in my pocket.  I tend to see patterns in text, so I guess you could say regular expressions are kinda like glasses to me &#8211; they bring a jumble presented to me into something that I can parse and make sense of.  Okay, maybe not exactly the glasses analogy I was looking for, but I think you get my point &#8211; regular expressions are just how I think of things.  As it turns out, the Ruby developers decided to make their regexps look like perl&#8217;s!  It&#8217;s a beautiful thing!  I can take my perl regex hacking almost verbatim to Ruby!</p>
<p>Anyway, it looks like the Ruby (on Rails) experiments are going better than expected (certainly better than the python experiments).  I have a few plans on where to take this new-found framework for a test drive, but that&#8217;s for a latter post!</p>
<p><em><strong>11:45 Update</strong></em> &#8211; After a bit of time trying to figure out how to get the gsub! command to work in block form, I got the wiki to do a search and replace of keywords ([[word]]) by looking up the keyword in the databse and returning the id of the document.  Here&#8217;s the show routine:</p>
<pre>
def show
    @page = Page.find(@params["id"])
    @page.text.gsub!(/\[\[(\w+)\]\]/) do |word|
        @keyword = Page.find(:first, :conditions =&gt; [ "name = ?", $1])
        if (@keyword)
            '&lt;a href="' + @keyword.id.to_s + '" rel="nofollow">' + $1 + '&lt;/a>'
        else
            '&lt;a href="/page/new" rel="nofollow">' + $1 + '&lt;/a>'
        end
    end
end
</pre>
<p>It&#8217;s not perfect, as it should really put the page title into the name field when going to a new page, but I&#8217;m not sure how to do that yet&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.rocklinfamily.com/technology/thoughts-on-ruby/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
