<?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>Hackerdude &#187; Ruby</title>
	<atom:link href="http://www.hackerdude.com/category/dev-platforms/ruby/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.hackerdude.com</link>
	<description>Software Development Blog by David Martinez</description>
	<lastBuildDate>Fri, 17 Sep 2010 18:31:30 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.4</generator>
		<item>
		<title>JIRA To Omnifocus Script</title>
		<link>http://www.hackerdude.com/2009/03/04/jira-to-omnifocus-script/</link>
		<comments>http://www.hackerdude.com/2009/03/04/jira-to-omnifocus-script/#comments</comments>
		<pubDate>Wed, 04 Mar 2009 18:47:37 +0000</pubDate>
		<dc:creator>David Martinez</dc:creator>
				<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Mac]]></category>

		<guid isPermaLink="false">http://www.hackerdude.com/2009/03/04/jira-to-omnifocus-script/</guid>
		<description><![CDATA[This script logs into your JIRA and creates OmniFocus tasks for each of the JIRA items that are assigned to you, so they sync to your Omnifocus for iPhone, you only have to keep track of one inbox, etc. It only takes a tiny bit of setup. Setting up To set this up, do the [...]]]></description>
			<content:encoded><![CDATA[<p>This script logs into your <a href="http://www.atlassian.com/software/jira/" title="JIRA: Task Tracking Software">JIRA</a> and creates <a href="http://www.omnigroup.com/applications/omnifocus/" title="Omnifocus - Professional Grade Desktop Task Mnagement">OmniFocus</a> tasks for each of the JIRA items that are assigned to you, so they sync to your Omnifocus for iPhone, you only have to keep track of one inbox, etc. It only takes a tiny bit of setup.</p>
<p><span id="more-548"></span>
<div class="setup_instructions">
<h4>Setting up</h4>
<p>To set this up, do the following:</p>
<ol>
<li><a href="http://www.hackerdude.com/wp-content/sample_code/jiratoomnifocus.zip">Download the script</a> and put it somewhere it will run</li>
<li>Install the required gems (<a href="http://appscript.sourceforge.net/" title="Appscript - Ruby applescript automation">appscript</a>, <a href="http://crypt.rubyforge.org/" title="Crypt: pure-ruby cryptographic cyphers">crypt</a>, <a href="http://gilesbowkett.blogspot.com/2008/09/password-gem-v12-released.html">password</a>) with gem install.</li>
<li>Go to JIRA and create a saved filter with whatever settings you like. Note the filter ID.</li>
<li>Go to the top of the jiratoomnifocus file and set it on the JIRA_FILTER_ID constant, and set the JIRA_BASE_URL to the URL of your JIRA installation.</li>
<li>If you like to keep your system very secure, take a look at the security warning, below, at this time</li>
<li>Run it. You will be asked to login the first time. After it's done, note the new tasks on your Omnifocus. Delete a task and run it again to see it add it again without asking you for authentication.</li>
</ol>
<p>You're set up! Now you can put it on a cron line, like this one which sets it to run at office hours (use cron -e on Terminal for this):</p>
<pre>
0,10,20,30,40,50 7-18 * * * /yourdir/jiratoomnifocus > /yourdir//log/jira_to_omnifocus.log 2>&#38;1
</pre>
<p>Congratulations! You now have only one inbox again. Let me know if you use it; I'd love to know of more ideas on how we can make it better/easier to setup.</p>
<div class="security_warning">
<h4>Security Warning</h4>
<p>The password for your JIRA account will be saved on a file on your computer called ~/.hackerdude/jira_credentials.yml. It is encrypted using blowfish using a constant key.</p>
<p>As long as both your jiratoomnifocus script and your credentials file are secured as (chmod 700 and owned by the user that will be running it on cron), you should be okay and secure (unless someone breaks into your account, in which case you have bigger problems than your JIRA access!). The crypt key used is a constant on the jiratoomnifocus script. Change the CRYPT_KEY key for any other random string of the same length and delete the jira_credentials.yml file (so it asks for your password again) and it will be recreated using your key the next time you start it.</p>
</div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.hackerdude.com/2009/03/04/jira-to-omnifocus-script/feed/</wfw:commentRss>
		<slash:comments>15</slash:comments>
		</item>
		<item>
		<title>Ruby Appscript &#8211; Sweet automation</title>
		<link>http://www.hackerdude.com/2009/01/23/ruby-appscript-sweet-automation/</link>
		<comments>http://www.hackerdude.com/2009/01/23/ruby-appscript-sweet-automation/#comments</comments>
		<pubDate>Sat, 24 Jan 2009 00:50:26 +0000</pubDate>
		<dc:creator>David Martinez</dc:creator>
				<category><![CDATA[Mac]]></category>
		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://www.hackerdude.com/2009/01/23/ruby-appscript-sweet-automation/</guid>
		<description><![CDATA[Yesterday a coworker pointed me to ruby's appscript. I have found it nothing short of amazing. I love my Mac, and many of us like the idea of automating our software, until we try to use AppleScript to do it. To say that Applescript is professional developer unfriendly is an understatement. I like ruby but [...]]]></description>
			<content:encoded><![CDATA[<p>Yesterday a coworker pointed me to ruby's appscript. I have found it nothing short of amazing.</p>
<p>I love my Mac, and many of us like the idea of automating our software, until we try to use AppleScript to do it. To say that Applescript is professional developer unfriendly is an understatement. I like ruby but to make ruby and applescript talk requires sending strings to osascript in just the right way and getting the output from osascript back. Not a lot of fun at all.</p>
<p>Enter appscript. <a href="http://appscript.sourceforge.net/" title="Appscript - Ruby applescript automation">Appscript</a> is a ruby library that interfaces with applescript seamlessly.</p>
<p><span id="more-541"></span>
<p>What's pretty amazing is its power after you spend a little while on the irb console and keep using the tab key for autocompletion. It even introspects the dictionary to see what is available at this time. It doesn't always give the right thing but by trying things out and with a bit of logic you always get there. </p>
<p>There's also an app called ASDictionary that will spit out the dictionary with ruby syntax, though I never found the dictionary all that useful anyway (I mean yes, it has definitions for everything, but it seldom provides info on exactly how everything is tied together or examples of use). I personally prefer trying things out on the console.</p>
<p>Here are a few examples of its use. You can do all this on irb immediately after installing it with <strong>sudo gem install appscript</strong>:</p>
<h4>Driving iCal</h4>
<p>This will get all your calendars and print their names:</p>
<pre class="ruby">&nbsp;
<span style="color:#CC0066; font-weight:bold;">require</span> <span style="color:#996600;">'appscript'</span>
app = Appscript.<span style="color:#9900CC;">app</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;iCal&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
app.<span style="color:#9900CC;">calendars</span>.<span style="color:#9900CC;">get</span>.<span style="color:#9900CC;">each</span> <span style="color:#006600; font-weight:bold;">&#123;</span> |cal| <span style="color:#CC0066; font-weight:bold;">puts</span> cal.<span style="color:#9900CC;">name</span>.<span style="color:#9900CC;">get</span> <span style="color:#006600; font-weight:bold;">&#125;</span>
&nbsp;</pre>
<p>Just expanding on this concept a little more, you can also grab all the to-dos:  </p>
<pre class="ruby">&nbsp;
app.<span style="color:#9900CC;">calendars</span>.<span style="color:#9900CC;">get</span>.<span style="color:#9900CC;">each</span> <span style="color:#006600; font-weight:bold;">&#123;</span> |cal|
  cal.<span style="color:#9900CC;">get</span>.<span style="color:#9900CC;">todos</span>.<span style="color:#9900CC;">get</span>.<span style="color:#9900CC;">each</span> <span style="color:#006600; font-weight:bold;">&#123;</span>|todo|
    <span style="color:#CC0066; font-weight:bold;">puts</span> todo.<span style="color:#9900CC;">summary</span>.<span style="color:#9900CC;">get</span>
  <span style="color:#006600; font-weight:bold;">&#125;</span>
<span style="color:#006600; font-weight:bold;">&#125;</span>
&nbsp;</pre>
<h4>Automating Safari. Ruby to Applescript to Javascript</h4>
<p>Haven't tried marshaling values back as I'm just exploring, but I don't see why it couldn't.</p>
<pre class="ruby">&nbsp;
<span style="color:#CC0066; font-weight:bold;">require</span> <span style="color:#996600;">'appscript'</span>
app = Appscript.<span style="color:#9900CC;">app</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;iCal&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
app.<span style="color:#9900CC;">open_location</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;http://www.google.com&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
window = app.<span style="color:#9900CC;">documents</span>.<span style="color:#9900CC;">get</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#006666;">0</span><span style="color:#006600; font-weight:bold;">&#93;</span>
window.<span style="color:#9900CC;">do_JavaScript</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;window.alert('Your title is '+document.title)&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
&nbsp;</pre>
<p>I'm sure you can find some use for this. I already did - I wrote myself a quick cron to add all the JIRA tasks assigned to me to <a href="http://www.omnigroup.com/applications/omnifocus/" title="Omnifocus - Professional Grade Desktop Task Mnagement">Omnifocus</a> if I don't already have them there. I'm looking forward to seeing what else I can put this to use.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.hackerdude.com/2009/01/23/ruby-appscript-sweet-automation/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>DHH: The Accept Header and Rails 1.1</title>
		<link>http://www.hackerdude.com/2006/03/13/dhh-the-accept-header-and-rails-11/</link>
		<comments>http://www.hackerdude.com/2006/03/13/dhh-the-accept-header-and-rails-11/#comments</comments>
		<pubDate>Mon, 13 Mar 2006 22:23:12 +0000</pubDate>
		<dc:creator>David Martinez</dc:creator>
				<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://www.hackerdude.com/2006/03/13/dhh-the-accept-header-and-rails-11/</guid>
		<description><![CDATA[Over at Loud Thinking,&#160; David Hanson has a great explanation of how you can use the accept header with Rails 1.1. &#160; technorati tags: rails, http]]></description>
			<content:encoded><![CDATA[<p>
Over at <a href="http://www.loudthinking.com/" target="_blank">Loud Thinking</a>,&nbsp; David Hanson has a great explanation of how you can use <a href="http://www.loudthinking.com/arc/000572.html" target="_blank">the accept header</a> with Rails 1.1.
</p>
<p>
&nbsp;
</p>
<p><!-- technorati tags begin -->
<p style="font-size:10px;text-align:right;">technorati tags: <a href="http://technorati.com/tag/rails" rel="tag">rails</a>, <a href="http://technorati.com/tag/http" rel="tag">http</a></p>
<p><!-- technorati tags end --></p>
]]></content:encoded>
			<wfw:commentRss>http://www.hackerdude.com/2006/03/13/dhh-the-accept-header-and-rails-11/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Parse Picasa XML with Rails</title>
		<link>http://www.hackerdude.com/2006/02/27/parse-picasa-xml-with-rails/</link>
		<comments>http://www.hackerdude.com/2006/02/27/parse-picasa-xml-with-rails/#comments</comments>
		<pubDate>Tue, 28 Feb 2006 06:33:07 +0000</pubDate>
		<dc:creator>David Martinez</dc:creator>
				<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://www.hackerdude.com/2006/02/27/parse-picasa-xml-with-rails/</guid>
		<description><![CDATA[Here's a helper I just wrote for a site of mine. I use it with my picasa XML albums to generate the appropriate links for Lokesh Dhakar's lightbox image viewer trick. You can change it to use your own image views by simply changing the &#34;slideshow&#34; method in the helper. It is also a good [...]]]></description>
			<content:encoded><![CDATA[<p>
Here's a helper I just wrote for a site of mine. I use it with my <a target="_blank" href="http://picasa.google.com/index.html">picasa XML albums</a> to generate the appropriate links for Lokesh Dhakar's <a target="_blank" href="http://www.dynamicdrive.com/dynamicindex4/lightbox/">lightbox image viewer</a> trick. You can change it to use your own image views by simply changing the &quot;slideshow&quot; method in the helper.
</p>
<p>It is also a good example of parsing an XML resource in ruby. I am parsing most of the metadata so you should be able to do a lot more with this.</p>
<p><span id="more-467"></span></p>
<p>
In the controller, you need to add the following:
</p>
<pre class="ruby">&nbsp;
  helper <span style="color:#ff3333; font-weight:bold;">:picasa_album</span>
&nbsp;</pre>
<p>
In your .rhtml file, add the lightbox tags:
</p>
<pre>&nbsp;
  &amp;lt;%= stylesheet_link_tag 'lightbox' %&amp;gt;
  &amp;lt;%= javascript_include_tag 'lightbox' %&amp;gt;
&nbsp;
  &amp;lt;div class=&amp;quot;slideshow&amp;quot; style=&amp;quot;margin: 2em 10em&amp;quot;&amp;gt;
    &amp;lt;%= slideshow( &amp;quot;http://yoursite.com&amp;quot;,
    url_for( &amp;quot;/path/to/album/index.xml&amp;quot;) ) %&amp;gt;
  &amp;lt;/div&amp;gt;
&nbsp;</pre>
<p>Finally, add <a href="http://hackerdude.com/wp-content/sample_code/picasa_album_helper.rb" title="Rails Picasa Album Helper">picasa_album_helper.rb</a> to the helpers directory.
</p>
<p>
Let me know of your experiences with this.
</p>
<p>
Have fun!&nbsp;
</p>
<p><b>Update 06/23/2006:</b> I got a patch for this not too long ago. Still waiting for confirmation before submitting it but I did add it to the subversion - see <a href="http://svn.hackerdude.com/websvn/listing.php?repname=railsplugins">the repository browser</a> for a version history.
</p>
<p><!-- technorati tags begin -->
<p style="font-size:10px;text-align:right;">technorati tags: <a href="http://technorati.com/tag/rails" rel="tag">rails</a>, <a href="http://technorati.com/tag/picasa" rel="tag">picasa</a>, <a href="http://technorati.com/tag/ruby" rel="tag">ruby</a>, <a href="http://technorati.com/tag/css" rel="tag">css</a></p>
<p><!-- technorati tags end --></p>
]]></content:encoded>
			<wfw:commentRss>http://www.hackerdude.com/2006/02/27/parse-picasa-xml-with-rails/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Curso de Rails: Desarrollo basado en Pruebas</title>
		<link>http://www.hackerdude.com/2006/02/21/curso_rails_unit_tests/</link>
		<comments>http://www.hackerdude.com/2006/02/21/curso_rails_unit_tests/#comments</comments>
		<pubDate>Wed, 22 Feb 2006 06:17:16 +0000</pubDate>
		<dc:creator>David Martinez</dc:creator>
				<category><![CDATA[Español]]></category>
		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://www.hackerdude.com/?p=461</guid>
		<description><![CDATA[He a&#241;adido al curso de rails el cap&#237;tulo pr&#225;ctico de pruebas de unidad, incluyendo el desarrollo basado en pruebas. Espero les guste, y les agradezco sus comentarios y apoyo a este proyecto.]]></description>
			<content:encoded><![CDATA[<p>He a&ntilde;adido al curso de rails el cap&iacute;tulo pr&aacute;ctico de pruebas de unidad, incluyendo el desarrollo basado en pruebas. Espero les guste, y les agradezco sus comentarios y apoyo a este proyecto.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.hackerdude.com/2006/02/21/curso_rails_unit_tests/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Rails: Mapeando objetos a relaciones</title>
		<link>http://www.hackerdude.com/2006/02/10/rails-mapeando-objetos-a-relaciones/</link>
		<comments>http://www.hackerdude.com/2006/02/10/rails-mapeando-objetos-a-relaciones/#comments</comments>
		<pubDate>Sat, 11 Feb 2006 06:48:01 +0000</pubDate>
		<dc:creator>David Martinez</dc:creator>
				<category><![CDATA[Español]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[XML]]></category>

		<guid isPermaLink="false">http://www.hackerdude.com/?p=457</guid>
		<description><![CDATA[He a&#241;adido el cap&#237;tulo de Mapeo de objetos a relaciones al curso de Rails. Todavia faltan dos tipos de relaciones y la parte pr&#225;ctica, pero como el contenido es muy &#250;til como referencia decid&#237; a&#241;adirlo de una vez. Espero les guste y que demuestren su gusto haciendo click en los anuncios. technorati tags: rails, ruby, [...]]]></description>
			<content:encoded><![CDATA[<p>He a&ntilde;adido el cap&iacute;tulo de Mapeo de objetos a relaciones al <a href="http://hackerdude.com/courses/rails/">curso de Rails</a>. Todavia faltan dos tipos de relaciones y la parte pr&aacute;ctica, pero como el contenido es muy &uacute;til como referencia decid&iacute; a&ntilde;adirlo de una vez.</p>
<p>Espero les guste y que demuestren su gusto haciendo click en los anuncios.</p>
<p><!-- technorati tags begin --></p>
<p style="font-size:10px;text-align:right;">technorati tags:<br />
<a href="http://technorati.com/tag/rails" rel="tag">rails</a>,<br />
<a href="http://technorati.com/tag/ruby" rel="tag">ruby</a>,<br />
<a href="http://technorati.com/tag/rubies" rel="tag">rubies</a>,<br />
<a href="http://technorati.com/tag/cursos" rel="tag">cursos</a>
</p>
<p><!-- technorati tags end --></p>
]]></content:encoded>
			<wfw:commentRss>http://www.hackerdude.com/2006/02/10/rails-mapeando-objetos-a-relaciones/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Eckel on Java vs Rails: The departure of the hyper-enthusiasts</title>
		<link>http://www.hackerdude.com/2005/12/19/eckel-on-java-vs-rails-the-departure-of-the-hyper-enthusiasts/</link>
		<comments>http://www.hackerdude.com/2005/12/19/eckel-on-java-vs-rails-the-departure-of-the-hyper-enthusiasts/#comments</comments>
		<pubDate>Mon, 19 Dec 2005 17:15:27 +0000</pubDate>
		<dc:creator>David Martinez</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://www.hackerdude.com/2005/12/19/eckel-on-java-vs-rails-the-departure-of-the-hyper-enthusiasts/</guid>
		<description><![CDATA[As always Bruce Eckel is a great read.. The Java hyper-enthusiasts have left the building, leaving a significant contingent of Java programmers behind, blinking in the bright lights without the constant drumbeat of boosterism. But the majority of programmers, who have been relatively quiet all this time, always knew that Java is a combination of [...]]]></description>
			<content:encoded><![CDATA[<p>As always Bruce Eckel is a great read..<br />
<blockquote cite="http://www.artima.com/forums/flat.jsp?forum=106&amp;thread=141312"><font color="#000000" face="tahoma,arial,sans-serif" size="-1"><br />The Java hyper-enthusiasts have left the building, leaving a significant contingent of Java programmers behind, blinking in the bright lights without the constant drumbeat of boosterism.<!--htdig_noindex--><!--/htdig_noindex-->    </font>
<p><font color="#000000" face="tahoma,arial,sans-serif" size="-1">But the majority of programmers, who have been relatively quiet all this time, always knew that Java is a combination of strengths and weaknesses. These folks are not left with any feelings of surprise, but instead they welcome the silence, because it's easier to think and work....</font></p>
<p>Clearly Ruby is making important contributions to the programming world. I think we're seeing the effects sooner in Python than elsewhere, but I suspect it will have an effect on Java as well, eventually, if only in the web-framework aspects. Java-on-rails might actually tempt me into creating a web app using Java again.However, I can't see Ruby, or anything other than C#, impacting the direction of the Java language, because of the way things have always happened in the Java world. And I think the direction that C# 3.0 may be too forward-thinking for Java to catch up to.</p></blockquote>
<p class="citation"><cite cite="http://www.artima.com/forums/flat.jsp?forum=106&amp;thread=141312"><a href="http://www.artima.com/forums/flat.jsp?forum=106&amp;thread=141312">Weblogs Forum - The departure of the hyper-enthusiasts</a></cite></p>
<p>Mainly, I think a pragmatic approach to a language is to assign value based on a) what you can accomplish with it, and b) how easy it is to write in the first place and maintain in the long run. So far Ruby is starting to become interesting on (a) - it was always interesting on (b) -, although we still have to do a lot of stuff in Java if we want to take advantage of a lot of features.</p>
<p>However, in Java there has been a lot of work already done to get you libraries and automated tools. I have been looking for some good IDEs for Ruby and I can't seem to find anything that is better than just using vim (I've looked, but that's another story) - Eclipse is my yardstick for comparison.</p>
<p>That means that I may want to switch to rails for web app development and maybe scripting, but not for any type of development where I have to apply deep pattern thinking and where I anticipate refactorings to come along as the system grows. It may be easier conceptually to do refactoring in Ruby, but that fact is superceded by the automatedness of doing it in Eclipse. It doesn't matter if it impacts a lot more files to, say change a member variable name in a domain object, in Java vs. Ruby if I can do it with Alt-R in Eclipse and in Ruby I have to go and change it manually - the masses will not switch until you give them this kind of capability.</p>
<p>On the other hand, I really do like the fact that you can get started in ruby from scratch in a few minutes using things like "gem install rails", vs. setting up a giant ant/java/spring/hibernate/tomcat on the java side.</p>
<p><!-- technorati tags begin -->
<p style="font-size:10px;text-align:right;">technorati tags: <a href="http://technorati.com/tag/languages" rel="tag">languages</a>, <a href="http://technorati.com/tag/java" rel="tag">java</a>, <a href="http://technorati.com/tag/ruby" rel="tag">ruby</a>, <a href="http://technorati.com/tag/rails" rel="tag">rails</a>, <a href="http://technorati.com/tag/web2.0" rel="tag">web2.0</a></p>
<p><!-- technorati tags end --></p>
]]></content:encoded>
			<wfw:commentRss>http://www.hackerdude.com/2005/12/19/eckel-on-java-vs-rails-the-departure-of-the-hyper-enthusiasts/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Tutor de Rails en EspaÃ±ol</title>
		<link>http://www.hackerdude.com/2005/12/13/tutor-de-rails-en-espanol/</link>
		<comments>http://www.hackerdude.com/2005/12/13/tutor-de-rails-en-espanol/#comments</comments>
		<pubDate>Wed, 14 Dec 2005 03:35:48 +0000</pubDate>
		<dc:creator>David Martinez</dc:creator>
				<category><![CDATA[Español]]></category>
		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://www.hackerdude.com/2005/12/13/tutor-de-rails-en-espanol/</guid>
		<description><![CDATA[De mi tutor de Rails en EspaÃ±ol: Este curso pretende proporcionar al usuario informaciÃ³n suficiente para hacer aplicaciones de web profesionales utilizando Ruby on Rails. EstÃ¡ enfocado a personas que ya sepan algo de programaciÃ³n en otros lenguajes, lo cual quiere decir que durante el curso harÃ© referencia a conceptos y librerÃ­as familiares a usuarios [...]]]></description>
			<content:encoded><![CDATA[<p>De mi tutor de Rails en EspaÃ±ol:</p>
<blockquote cite="http://hackerdude.com/courses/rails/"><p>Este curso pretende proporcionar al usuario informaciÃ³n suficiente para hacer aplicaciones de web profesionales utilizando Ruby on Rails. EstÃ¡ enfocado a personas que ya sepan algo de programaciÃ³n en otros lenguajes, lo cual quiere decir que durante el curso harÃ© referencia a conceptos y librerÃ­as familiares a usuarios de otros lenguajes y productos.</p></blockquote>
<p class="citation"><cite cite="http://hackerdude.com/courses/rails/"><a href="http://hackerdude.com/courses/rails/">Tutor de Ruby on Rails</a></cite></p>
<p></p>
<p><!-- technorati tags begin -->
<p style="font-size:10px;text-align:right;">technorati tags: <a href="http://technorati.com/tag/rails" rel="tag">rails</a>, <a href="http://technorati.com/tag/espaÃ±ol" rel="tag">espaÃ±ol</a>, <a href="http://technorati.com/tag/web2.0" rel="tag">web2.0</a>, <a href="http://technorati.com/tag/ruby" rel="tag">ruby</a>, <a href="http://technorati.com/tag/cursos" rel="tag">cursos</a>, <a href="http://technorati.com/tag/tutoriales" rel="tag">tutoriales</a></p>
<p><!-- technorati tags end --></p>
]]></content:encoded>
			<wfw:commentRss>http://www.hackerdude.com/2005/12/13/tutor-de-rails-en-espanol/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>RIFE vs Rails side by side</title>
		<link>http://www.hackerdude.com/2005/12/06/rife-vs-rails-side-by-side/</link>
		<comments>http://www.hackerdude.com/2005/12/06/rife-vs-rails-side-by-side/#comments</comments>
		<pubDate>Tue, 06 Dec 2005 21:37:52 +0000</pubDate>
		<dc:creator>David Martinez</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://www.hackerdude.com/?p=433</guid>
		<description><![CDATA[Like many other java developers, I am currently using Spring and Hibernate, so I can't attest to the quality of RIFE. But I thought this was interesting: This is a side-by-side comparison of the RIFE source vs. the Rails source for the same feature (Ta-da list vs Bla bla list). Just another thing to add [...]]]></description>
			<content:encoded><![CDATA[<p>
Like many other java developers, I am currently using Spring and<br />
Hibernate, so I can't attest to the quality of RIFE. But I thought this<br />
was interesting: This is a <a href="http://weblog.rubyonrails.com/archives/2005/03/19/bla-bla-list-cloning-a-rails-app-in-rife/">side-by-side<br />
comparison</a> of the RIFE source vs. the Rails source for the<br />
same feature (<a href="http://www.tadalist.com/">Ta-da list</a><br />
vs <a href="http://www.blablalist.com/">Bla bla list</a>).<br />
Just another thing to add to the ever-growing list of things to check<br />
out.</p>
<p>Note that I don't have an opinion on this because I don't know both<br />
toolsets (and like many others I don't sound very smart when comparing<br />
something I know vs something I don't know). <img src='http://www.hackerdude.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.hackerdude.com/2005/12/06/rife-vs-rails-side-by-side/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>One-to-One relationships with Rails</title>
		<link>http://www.hackerdude.com/2005/11/28/one-to-one-relationships-with-rails/</link>
		<comments>http://www.hackerdude.com/2005/11/28/one-to-one-relationships-with-rails/#comments</comments>
		<pubDate>Mon, 28 Nov 2005 18:02:03 +0000</pubDate>
		<dc:creator>David Martinez</dc:creator>
				<category><![CDATA[CBBTR]]></category>
		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://www.hackerdude.com/?p=428</guid>
		<description><![CDATA[How to define and populate a one-to-one relationship using ActiveRecord and Ruby on Rails.]]></description>
			<content:encoded><![CDATA[<p>This is a lot easier than I thought it would be and it actually took me longer than it should have because I was trying to do it manually.</p>
<p><span id="more-428"></span></p>
<p>First you need to define the relationship on the parent and children models:</p>
<p><code lang="ruby"><br />
class Person < ActiveRecord::Base<br />
  has_one  :person_details, :dependent=>true<br />
end</p>
<p>class PersonDetails < ActiveRecord::Base<br />
  belongs_to :person<br />
end</p>
<p></code></p>
<p>Note that this automatically will provide with a person_details member for person when it gets retrieved.</p>
<p>Now on the controller, here's the CRUD:</p>
<p></code><code lang="ruby"><br />
  def create<br />
    @person = Person.new(params[:person])<br />
    @person_details = PersonDetails.new(params[:person_details])<br />
    @person.person_details = @person_details<br />
    if @person.save<br />
       # Cool, you're done! It saves the person_details as well.<br />
    end<br />
  end</p>
<p> def edit<br />
   @person = Person.find(params[:id])<br />
   @person_details = @person.person_details<br />
 end</p>
<p>def update<br />
  @person = Person.find(params[:id])<br />
  if @person.update_attributes(params[:person]) and<br />
     @person.person_details.update_attributes(params[:person_details])<br />
    # Cool, you're done!<br />
  end<br />
end</p>
<p>def destroy<br />
  Person.find(params[:id]).destroy<br />
end<br />
</code></p>
<p>Now your rhtml _form.rhtml must have things like:</p>
<p><code lang="ruby"><br />
 text_field 'person_details', column.name<br />
 text_field 'person, column.name<br />
</code></p>
<p>And you will get two sets of parameters (as you can see in your controller code), params[:person], and params[:person_details]. Your instance variables to set the current values on the view side would be @person and @person_details.</p>
<p>And I was sitting there writing custom code to find/save.. Ugh!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.hackerdude.com/2005/11/28/one-to-one-relationships-with-rails/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

