<?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>The True Tribe &#187; Ruby on Rails</title>
	<atom:link href="http://www.thetruetribe.com/tag/ruby-on-rails/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.thetruetribe.com</link>
	<description>Vroom! That&#039;s us leaving IE in the dust.</description>
	<lastBuildDate>Fri, 22 Jan 2010 23:34:03 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Using the Amazon ECS Gem In Your Rails App</title>
		<link>http://www.thetruetribe.com/2010/01/amazon-ecs-gem-in-rails/</link>
		<comments>http://www.thetruetribe.com/2010/01/amazon-ecs-gem-in-rails/#comments</comments>
		<pubDate>Sun, 10 Jan 2010 08:06:00 +0000</pubDate>
		<dc:creator>jdempcy</dc:creator>
				<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[Amazon]]></category>
		<category><![CDATA[JSON]]></category>

		<guid isPermaLink="false">http://www.thetruetribe.com/?p=292</guid>
		<description><![CDATA[Amazon.com offers a tremendous amount of web services to developers looking to display their products. They benefit from this because developers make all sorts of cool apps for browsing Amazon. For example, nifty 3D Flash experience CoolIris (formerly known as &#8216;PicLens&#8217;) added Amazon functionality to their product. It&#8217;s a win-win for developers and Amazon because [...]]]></description>
			<content:encoded><![CDATA[<p>Amazon.com offers a tremendous amount of web services to developers looking to display their products. They benefit from this because developers make all sorts of cool apps for browsing Amazon. For example, nifty 3D Flash experience <a href="http://www.cooliris.com/tab/#c=322&amp;f=Channels">CoolIris</a> (formerly known as &#8216;PicLens&#8217;) <a href="http://www.readwriteweb.com/archives/piclens_review_videos.php">added Amazon functionality to their product</a>. It&#8217;s a win-win for developers and Amazon because it drives traffic to the site while paying developers referral fees.<span id="more-292"></span></p>
<p>If you&#8217;re a Rails developer looking to tap into Amazon&#8217;s massive warehouse of product data, you&#8217;re in luck. <a href="http://www.pluitsolutions.com/projects/amazon-ecs">Pluit Solutions</a> has released the amazon-ecs gem exactly for this purpose. It&#8217;s as easy to install as:</p>
<pre>gem install amazon-ecs</pre>
<p>If that doesn&#8217;t work for you, you can always  <a href="http://github.com/jugend/amazon-ecs">download it from GitHub</a> then install it locally. Or you can clone it at this URL: git://github.com/jugend/amazon-ecs.git</p>
<p>It&#8217;s pretty straightforward to set up. The first thing you&#8217;ll need to do is get an Amazon Web Services account if you don&#8217;t already have one. You can <a href="http://aws.amazon.com/">sign up for AWS here</a>.</p>
<p>You&#8217;ll need to know your developer token to connect to AWS. They recently made it so you need to specify a secret token as well. It would be something like this in your <code>/config/environment.rb</code> file:</p>
<pre># Be sure to restart your server when you modify this file

# Specifies gem version of Rails to use when vendor/rails is not present
RAILS_GEM_VERSION = '2.3.2' unless defined? RAILS_GEM_VERSION

# Bootstrap the Rails environment, frameworks, and default configuration
require File.join(File.dirname(__FILE__), 'boot')

Rails::Initializer.run do |config|
  config.gem "amazon-ecs", :lib =&gt; "amazon/ecs"
  config.time_zone = 'UTC'
  config.frameworks -= [ :active_record ]
end

require 'rubygems'
require 'amazon/ecs'
Amazon::Ecs.options = {:aWS_access_key_id =&gt; '************************', :aWS_secret_key =&gt; '**********************'}</pre>
<p>Just replace the asterisks with your actual AWS public and private keys and you&#8217;re set!</p>
<p>Say you want to run a search at the /amazon/ controller&#8217;s index action. Let&#8217;s generate the controller now:</p>
<pre>ruby script/generate controller Amazon</pre>
<p>Now in the /app/controllers/amazon_controller.rb file you can define the index action like so:</p>
<pre>class AmazonController &lt; ApplicationController
  def index
  end
end</pre>
<p>This is where we&#8217;ll be putting the service call to AWS to get our data back.</p>
<p>The next step is to add in a hard coded search query. You can make this based on user input later, but for now, let&#8217;s just search for &#8216;Ghostbusters&#8217; and see what we get back.</p>
<pre>class AmazonController &lt; ApplicationController
  def index
    query = params[:q]
    page = params[:p]
    @results = Amazon::Ecs.item_search('Ghostbusters', :response_group =&gt; 'Medium', :search_index =&gt; 'DVD', :item_page =&gt; page).items
   end
end</pre>
<p>To display the data, we&#8217;ll need to make a view for it. Let&#8217;s create a new file in <code>/views/amazon</code> called <code>index.html.erb</code>.</p>
<p>The view can look like this:</p>
<pre>  (
    {
    results:
      [
        &lt;% @results.each_with_index do |result, i| %&gt;
          {
            title: "&lt;%=h result.get('title') %&gt;",
            detailpageurl: "&lt;%=h result.get('detailpageurl') %&gt;",
            imageurl: "&lt;%=h result.get('mediumimage/url') %&gt;",
            largeimageurl: "&lt;%=h result.get('largeimage/url') %&gt;"
          }&lt;% if i != @results.length%&gt;,&lt;% end %&gt;
        &lt;% end %&gt;
      ]
    }
  )</pre>
<p>What&#8217;s that, you might ask? It&#8217;s just simple JSON actually. We get the data back as pure Ruby objects but for Ajax applications it&#8217;s much easier to work with as JSON. You can just as easily make it HTML, but I thought you might want to see the data displayed in JSON first.</p>
<p>Fire up the Ruby server with a <code>ruby script/server</code> call and hit up <code>localhost:3000/Amazon</code> in a browser. You should see a JSON response with a bunch of data pertaining to our query, namely, the movie Ghostbusters.</p>
<p>If you were to display this data as images and links on a page, you could do something like this:</p>
<pre>&lt;% @results.each_with_index do |result, i| %&gt;
	&lt;%= content_tag :li, link_to(image_tag(result.get('mediumimage/url'), {:alt =&gt; result.get('title')}), result.get('detailpageurl')) %&gt;
&lt;% end %&gt;</pre>
<p>If you change the view to be HTML it should render all of the images inside of <code>li</code> elements in the page. The thing is, it&#8217;s still always displaying Ghostbusters data. Now we can make it pull in from a query string so it dynamically displays data instead:</p>
<pre>class AmazonController &lt; ApplicationController
  def index
    query = params[:q]
    @results = Amazon::Ecs.item_search(query, :response_group =&gt; 'Medium', :search_index =&gt; 'DVD', :item_page =&gt; page).items
   end
end</pre>
<p>Now if you go to <code>localhost:3000/amazon?q=2001+a+space+odyssey</code> you should see results pertaining to that masterpiece instead.</p>
<p>And next we can even add a page specification:</p>
<pre>class AmazonController &lt; ApplicationController
  def index
    query = params[:q]
    page = params[:p]
    @results = Amazon::Ecs.item_search(query, :response_group =&gt; 'Medium', :search_index =&gt; 'DVD', :item_page =&gt; page).items
   end
end</pre>
<p>At this point you can get more than one page of results by specifying the q parameter, e.g.: <code>localhost:3000/amazon?q=2001+a+space+odyssey&amp;p=2</code> returns results 11-20.</p>
<p>It&#8217;s hard coded to searching in &#8216;DVD&#8217; right now. If we change it like so we can search everything:</p>
<pre>class AmazonController &lt; ApplicationController
  def index
    query = params[:q]
    page = params[:p]
    @results = Amazon::Ecs.item_search(query, :response_group =&gt; 'Medium', :item_page =&gt; page).items
   end
end</pre>
<p>I just removed the <code>:search_index</code> specification in the service call. It&#8217;s the same thing as specifying <code>:search_index =&gt; 'All'</code> so you can do that instead if you wish.</p>
<p>Valid search indexes are:</p>
<pre> 	%w[ All Apparel Automotive Baby Beauty Blended Books Classical DigitalMusic DVD Electronics ForeignBooks GourmetFood Grocery HealthPersonalCare Hobbies HomeGarden HomeImprovement Industrial Jewelry KindleStore Kitchen Magazines Merchants Miscellaneous MP3Downloads Music MusicalInstruments MusicTracks OfficeProducts OutdoorLiving PCHardware PetSupplies Photo Shoes SilverMerchants Software SoftwareVideoGames SportingGoods Tools Toys UnboxVideo VHS Video VideoGames Watches Wireless WirelessAccessories ]</pre>
<p>Enjoy and best of luck with your Amazon app!</p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.thetruetribe.com%2F2010%2F01%2Famazon-ecs-gem-in-rails%2F&amp;linkname=Using%20the%20Amazon%20ECS%20Gem%20In%20Your%20Rails%20App"><img src="http://www.thetruetribe.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://www.thetruetribe.com/2010/01/amazon-ecs-gem-in-rails/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Best of 2009, Ruby on Rails Edition</title>
		<link>http://www.thetruetribe.com/2010/01/best-of-2009-ruby-on-rails-edition/</link>
		<comments>http://www.thetruetribe.com/2010/01/best-of-2009-ruby-on-rails-edition/#comments</comments>
		<pubDate>Sun, 03 Jan 2010 06:13:31 +0000</pubDate>
		<dc:creator>jdempcy</dc:creator>
				<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[git]]></category>

		<guid isPermaLink="false">http://www.thetruetribe.com/?p=267</guid>
		<description><![CDATA[It was a good year for Rails. In 2009, we saw a number of exciting developments and a lot of great tools were released. Rails 2.3 was released in March 2009 and met with much fanfare. Rails has seen the introduction of templates, engines and a lot of other great features. 
Thanks to the popularity [...]]]></description>
			<content:encoded><![CDATA[<p>It was a good year for Rails. In 2009, we saw a number of exciting developments and a lot of great tools were released. Rails 2.3 was released in March 2009 and met with much fanfare. Rails has seen the introduction of templates, engines and a lot of other great features. <span id="more-267"></span></p>
<p>Thanks to the popularity of high profile websites that use Rails such as Hulu and Twitter, it is now considered a viable option for large sites. This kind of exposure means a lot of new development and movement. Rails seems to have outgrown many of the scaling woes of yesteryear. Now that it&#8217;s recognized in the mainstream as a stable and feature-rich platform for making websites, adoption has taken off, which means more tutorials, more resources, less bugs, lower barrier to entry and an overall better experience all around.</p>
<p>Another great development occurred quite recently in the Rails community. Two days before Christmas, on December 23, 2009, it was announced that <a href="http://en.wikipedia.org/wiki/Merb">Merb</a> would be merged into Rails 3. This is another huge development which will end the duplication of efforts and fracturing of the developer community that occurred due to competition between Merb and Rails.</p>
<p>In the spirit of celebrating this current Rails renaissance, here are some of the best Rails resources we&#8217;ve come across in the past year. We hope you find these as useful as we did!</p>
<h3><a href="http://lesscss.org/">Less CSS</a></h3>
<p><a href="http://www.thetruetribe.com/wp-content/uploads/2010/01/less-logo.png"><img class="alignnone size-full wp-image-271" title="less-logo" src="http://www.thetruetribe.com/wp-content/uploads/2010/01/less-logo.png" alt="" width="199" height="81" /></a></p>
<p>Less is an extension for CSS that allows you to use variables, perform operations such as mathematical calculations  and other neat features. It uses a Ruby script to read the .less file and generate a .css file to serve up to the browser.</p>
<p>Having variables is hugely helpful and it seems like an oversight in the CSS spec that it wasn&#8217;t included to begin with. Also, being able to add modifiers is nice. You can add, subtract, multiply, divide and even change colors. For instance, #FF0 + #00F would equal #FFF.</p>
<p>They also have mix-ins, which are classes that you can include in selectors, and it will include all of the properties from that class. This is the same thing functionally as adding that class to the elements matched by the selector, but without going into the HTML code. Mix-ins aren&#8217;t allowing us to do anything new that we couldn&#8217;t do already by adding the classes in HTML, but now it allows us to do this in CSS, without even touching the HTML. Some people will like this feature, others will deplore it&#8211; after all, we have a perfectly functional system where we can add multiple classes to a given element to achieve the same effect. But, I for one feel that this is a very useful feature to have. This is great for its reuse of code, and I love making modular CSS classes (for example, &#8220;rounded-corners&#8221;) that can be mixed into other CSS selectors.</p>
<h3><a href="http://git-scm.com/">Git</a> and <a href="http://github.com/">GitHub</a>, Social Coding</h3>
<p><a href="http://git-scm.com/"><img class="alignnone size-full wp-image-269" title="200px-Git-logo.svg" src="http://www.thetruetribe.com/wp-content/uploads/2010/01/200px-Git-logo.svg_.png" alt="git" width="200" height="73" /></a></p>
<p>These are two of the most useful tools of the year, hands down. Git caused a paradigm shift in distributed development. GitHub has become the de facto standard for Git hosting. If you&#8217;re unfamiliar with Git, read up on <a href="http://en.wikipedia.org/wiki/Git_%28software%29">the Wikipedia page</a>. To summarize, it&#8217;s a code versioning system that is well-suited for distributed development groups and open source software. It encourages users to make a fork of the repository so that any useful bug fixes, additions and changes can be easily merged back in, should the developers so desire.</p>
<p><a href="http://github.com/"><img class="alignnone size-full wp-image-270" title="github" src="http://www.thetruetribe.com/wp-content/uploads/2010/01/github.png" alt="github" width="100" height="45" /></a></p>
<p>I don&#8217;t see the advantage of using Git for personal projects or small in-house projects, but it is wonderful for open source efforts like Rails. It&#8217;s certainly a fine choice for any project, though I don&#8217;t see a big advantage over, say, Subversion, until you get into large scale distributed development situations like open source projects. Once you&#8217;re looking at open source projects, like those hosted on GitHub, we&#8217;re talking about a paradigm shift in efficiency.</p>
<p>Historically, most people would download zipped packages of code. Git encourages forking the repository instead. Let&#8217;s look at a quick example of how this works with Rails plugins.</p>
<p>Typically you could install a plugin by downloading some files somewhere and installing them, either with a script or by decompressing them directly to your vendor directory. This works fine but is unidirectional &#8212; you can only get the file from the developer, there is never an opportunity to submit code back, say, if you fix a bug.</p>
<p>The paradigm shift in efficiency that Git brings about is closing the loop: it allows you to easily submit code back to the trunk, thus capturing all those useful improvements to the code that would otherwise be lost on so many hard drives.</p>
<p>With GitHub, instead of downloading the Rails plugin, you fork the Git repositor to your vendor directory. Then, if you have to make changes to the plugin (which I almost always have to do, despite my best efforts to avoid it), you still retain the ability to update the code without losing your fixes. The old way was that if I wanted to upgrade a plugin that I had customized, I would have to download the new one and then manually go through and make whatever customizations I&#8217;d done. This way, you can automate the merging process and only have to go in if there are conflicts. That&#8217;s a big win to me. Then, if I actually do something with a plugin that others might find useful, I can offer up my own fork on GitHub, or submit it to the trunk if I think it&#8217;s useful enough to be included there.</p>
<p>Although Git was released in 2005 and GitHub in 2008, I included them on the 2009 list here because I think they have really broken through to the mainstream in a big way this past year. GitHub achieved meteoric rise during 2009. In January alone 17,000 new repositories were made, according to a talk given by GitHub founders at Yahoo in February of that year. In July of 2009 they had 90,000 unique repositories, double the previous year&#8211; and 45,000 forks of those repositories.</p>
<p>So, get on the bandwagon! Head over to GitHub and see what they have to offer. Or, if you don&#8217;t know where to start, check out this next useful resource for pointers &#8230;</p>
<h3><a href="http://www.ruby-toolbox.com/">The Ruby Toolbox</a></h3>
<p><a href="http://www.ruby-toolbox.com/"><img class="alignnone size-full wp-image-268" title="Toolbox_Red-256x256" src="http://www.thetruetribe.com/wp-content/uploads/2010/01/Toolbox_Red-256x256.png" alt="" width="256" height="256" /></a></p>
<p>The Ruby Toolbox is a wonderful resource for finding out what is popular. It uses metrics such as SVN commits and GitHub forks to determine which Ruby scripts are most popular. You can find out about a lot of great tools this way. I&#8217;ve discovered plenty of useful Rails gems and plugins here. There are also some useful standalone Ruby scripts for a variety of development tasks, such as Less, which doesn&#8217;t depend on Rails to do it&#8217;s thing.</p>
<h3><a href="http://github.com/sandal/prawn">Prawn</a>, PDF Generation Made Easy</h3>
<p>Prawn is a gem for generating PDFs. Let me tell you, working with PDFs is never easy, but Prawn greatly reduces the pain.</p>
<p>Check out <a href="http://railstips.org/2008/10/14/how-to-generate-pdfs-in-rails-with-prawn">this tutorial at RailsTips</a> for more info.</p>
<h3><a href="http://www.ruby-toolbox.com/categories/prototype_replacements.html">jRails</a></h3>
<p>I think it&#8217;s pretty obvious that jQuery has hit the big time in popularity. Endorsements by Microsoft, Amazon.com and other major players have led it to become the go-to JavaScript library of 2009. While Prototype still hangs in there, and MooTools has a great offering, an article I read recently summed it up perfectly when they said &#8216;jQuery is the guitar.&#8217; It had a screen grab of Google search results for guitar versus banjo, along with similar numbers for jquery versus mootools. You get the idea. If you aren&#8217;t using jQuery, you&#8217;re playing the banjo. If you want to really rock out, get on the bandwagon!</p>
<p>I am being facetious here but there is certainly some truth to the fact that a web developer in 2010 must be well-versed in jQuery. It&#8217;s also a viable alternative to Prototype in Ruby on Rails. In fact, I&#8217;ve heard that Rails 3 will be JavaScript framework agnostic, but don&#8217;t quote me on that.</p>
<p>In any case, you don&#8217;t have to wait until Rails 3 to start using jQuery in your Rails app. Simply install the jRails gem and you can go along using all those nifty Rails helpers, completely unaware that they are now implemented in jQuery instead of Prototype. Isn&#8217;t encapsulation great?</p>
<h3><a href="http://haml-lang.com">HAML</a></h3>
<p><a href="http://haml-lang.com"><img class="alignnone size-full wp-image-273" title="haml" src="http://www.thetruetribe.com/wp-content/uploads/2010/01/haml.gif" alt="" width="217" height="225" /></a></p>
<p>HAML (pronounced like Mark &#8220;Luke Skywalker&#8221; Hamill&#8217;s last name) is a great alternative to HTML. You write clean, concise HAML and the parser generates verbose and ugly HTML to serve up to the browser. Thus you can avoid typing those obnoxious closing tags that markup languages are so fond of. Keep your code simple, clean and pure. Or that&#8217;s the idea.</p>
<p>In practice, HAML can be a bit complex. Check out <a href="http://en.wikipedia.org/wiki/Haml">the HAML Wikipedia page</a> to see what I mean &#8212; look at all those obscure symbols. But once you learn what they all mean, it <em>is</em> a very concise, some might say beautiful language.</p>
<h3><a href="http://www.ruby-toolbox.com/categories/rails_file_uploads.html">Paperclip</a></h3>
<p>What can I say? Paperclip rocks. It is the standard for attachments in Rails and with good reason. It has been consistently updated, bug-fixed, and best of all, it is simple with not a bit of bloat. It requires the bare minimum of information from you, the developer, and does all the heavy lifting&#8211; even light lifting like database migrations&#8211; for you.</p>
<p>The next time you need to allow for file uploads in your Rails app, look no further than Paperclip.</p>
<h3><a href="http://github.com/mbleigh/acts-as-taggable-on">Acts_As_Taggable_On</a>, a Gem For Tagging</h3>
<p>Originally forked from Acts As Taggable On Steroids, the truncated form, has a number of improvements and goodies. Here is an excerpt from the Readme:</p>
<blockquote><p>This plugin was originally based on Acts as Taggable on Steroids by Jonathan Viney. It has evolved substantially since that point, but all credit goes to him for the initial tagging functionality that so many people have used.</p>
<p>For instance, in a social network, a user might have tags that are called skills, interests, sports, and more. There is no real way to differentiate between tags and so an implementation of this type is not possible with acts as taggable on steroids.</p>
<p>Enter Acts as Taggable On. Rather than tying functionality to a specific keyword (namely &#8220;tags&#8221;), acts as taggable on allows you to specify an arbitrary number of tag &#8220;contexts&#8221; that can be used locally or in combination in the same way steroids was used.</p></blockquote>
<p>Read more at <a href="http://github.com/mbleigh/acts-as-taggable-on">Github</a>.</p>
<h3><a href="http://ts.freelancing-gods.com/">Thinking Sphinx</a>, Front End to Sphinx Search Engine</h3>
<p><a href="http://ts.freelancing-gods.com/"><img class="alignnone size-medium wp-image-272" title="ts-logo" src="http://www.thetruetribe.com/wp-content/uploads/2010/01/ts-logo-300x64.gif" alt="" width="300" height="64" /></a></p>
<p>Thinking Sphinx is a great Ruby client to the Sphinx search engine that allows your Rails application to seamlessly integrate with Sphinx. This means you can get blazing-fast search results that are so fast because they&#8217;ve been optimized with filesystem-based indices, and even delta indices which only track changes to those indices, meaning they can avoid database calls when possible. Sounds fancy, huh? In practice, it&#8217;s a relatively painless set up that gets you professional quality search results. Sure, it can&#8217;t beat Google Mini, and feature for feature, heavy hitters like Java&#8217;s SOLR may win out, but for every project I&#8217;ve worked on, this has been sufficient. I like it a lot better than Ultrasphinx, the other Sphinx front end I&#8217;ve worked with.</p>
<p>All right, that&#8217;s all I have for now.  I&#8217;m sure I missed tons of great resources.</p>
<p>Please add your own favorite Ruby on Rails gems, plugins and resources in the comments!</p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.thetruetribe.com%2F2010%2F01%2Fbest-of-2009-ruby-on-rails-edition%2F&amp;linkname=Best%20of%202009%2C%20Ruby%20on%20Rails%20Edition"><img src="http://www.thetruetribe.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://www.thetruetribe.com/2010/01/best-of-2009-ruby-on-rails-edition/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Tracking What&#8217;s Hot with Ruby Toolbox</title>
		<link>http://www.thetruetribe.com/2009/07/tracking-whats-hot-with-ruby-toolbox/</link>
		<comments>http://www.thetruetribe.com/2009/07/tracking-whats-hot-with-ruby-toolbox/#comments</comments>
		<pubDate>Wed, 15 Jul 2009 00:59:21 +0000</pubDate>
		<dc:creator>jdempcy</dc:creator>
				<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[plugins]]></category>

		<guid isPermaLink="false">http://wordpress.thetruetribe.com/?p=176</guid>
		<description><![CDATA[Knowing what software is popular, current and updated regularly is a crucial aspect to developing successful websites. All developers benefit from being knowledgeable about what software is kept up to date but for Ruby on Rails developers this is doubly true. Enter Ruby Toolbox, a website tracking Rails plugin popularity on Github.The reason Ruby Toolbox [...]]]></description>
			<content:encoded><![CDATA[<p>Knowing what software is popular, current and updated regularly is a crucial aspect to developing successful websites. All developers benefit from being knowledgeable about what software is kept up to date but for Ruby on Rails developers this is doubly true. Enter <a title="Ruby Toolbox, an excellent resource for Rails plugins" href="http://www.ruby-toolbox.com">Ruby Toolbox</a>, a website tracking Rails plugin popularity on Github.<span id="more-176"></span>The reason Ruby Toolbox is so valuable is because it is current and offers you a snapshot of the past 60 days of activity. In the world of Ruby on Rails, things change rapidly, and last year&#8217;s solution may not work with this year&#8217;s release of Rails.</p>
<p><img class="alignnone size-full wp-image-178" title="ruby-toolbox-logo" src="http://wordpress.thetruetribe.com/wp-content/uploads/2009/07/ruby-toolbox-logo.jpg" alt="ruby-toolbox-logo" width="549" height="269" style="position: relative; left: -25px;" /></p>
<p>Searching on Google for the best solutions in Rails can be a daunting task, especially if you don&#8217;t know what options are available. There are simply so many different considerations that it&#8217;s easy to overlook features. Having a site like Ruby Toolbox at your disposal is a tremendous boon to productivity.</p>
<p>I&#8217;d wager that a part of the usefulness comes from simply having a &#8220;checklist&#8221; to go through for your site. As each project comes along, you can look at the feature requirements and then choose your tools: RSS feeds, SEO-friendly URLs, CSS frameworks, you name it, and if it&#8217;s a useful acronym that eases development, chances are they&#8217;ve got it!</p>
<p><img class="alignnone size-full wp-image-177" title="ruby-toolbox-graph" src="http://wordpress.thetruetribe.com/wp-content/uploads/2009/07/ruby-toolbox-graph.jpg" alt="ruby-toolbox-graph" width="500" height="454" /></p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.thetruetribe.com%2F2009%2F07%2Ftracking-whats-hot-with-ruby-toolbox%2F&amp;linkname=Tracking%20What%26%238217%3Bs%20Hot%20with%20Ruby%20Toolbox"><img src="http://www.thetruetribe.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://www.thetruetribe.com/2009/07/tracking-whats-hot-with-ruby-toolbox/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Useful MySQL commands with Ruby on Rails on a Mac or in Linux</title>
		<link>http://www.thetruetribe.com/2009/07/useful-mysql-commands-with-ruby-on-rails-on-a-mac-or-in-linux/</link>
		<comments>http://www.thetruetribe.com/2009/07/useful-mysql-commands-with-ruby-on-rails-on-a-mac-or-in-linux/#comments</comments>
		<pubDate>Tue, 14 Jul 2009 05:25:14 +0000</pubDate>
		<dc:creator>grandecomplex</dc:creator>
				<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[mysql]]></category>

		<guid isPermaLink="false">http://wordpress.thetruetribe.com/?p=46</guid>
		<description><![CDATA[Because RoR is so high level often times you can feel disconnected with what&#8217;s under the hood. Often times you need to view what objects, or columns, you are working with. Or you delete columns. Here are a handful of common mysql commands that I use often in RoR.
First of all, you may need to [...]]]></description>
			<content:encoded><![CDATA[<p>Because RoR is so high level often times you can feel disconnected with what&#8217;s under the hood. Often times you need to view what objects, or columns, you are working with. Or you delete columns. Here are a handful of common mysql commands that I use often in RoR.<span id="more-46"></span></p>
<p>First of all, you may need to locate mysql. Your best guess is in /usr/local/</p>
<pre name="code" class="sql">alex-grandes-macbook:~ alexgrande$ ls /usr/local/
bin				mysql
etc				mysql-5.0.77-osx10.5-x86</pre>
<p>Next you want to make that mysql command accessible because in /usr/local you won&#8217;t be able to get to it easily.</p>
<pre class="code">alex-grandes-macbook:~ alexgrande$ mysql
-bash: mysql: command not found</pre>
<p> <img src='http://www.thetruetribe.com/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> </p>
<p>So we&#8217;ll create a symbolic link to do so.</p>
<pre class="code">alex-grandes-macbook:~ alexgrande$ sudo ln -s /usr/local/mysql/bin/mysql /usr/bin/mysql
alex-grandes-macbook:~ alexgrande$</pre>
<p>sudo (Getting root access. You may have to enter the admin password.)</p>
<p>ln -s (symbol link command)</p>
<p>/usr/bin (a directory to access any file. /usr/bin/mysql is now just like a shortcut in windows.)</p>
<p>Now we can get into the mysql.</p>
<p>First grab the database info from your database.yml file for development. Here&#8217;s mine:</p>
<pre name="code" class="code ruby">development:
  adapter: mysql
  encoding: utf8
  database: whily_development
  username: root
  password:
  host: localhost</pre>
<p>Use this info to connect to the db like so:</p>
<pre class="code">alex-grandes-macbook:whily alexgrande$ mysql -u root -D whily_development
mysql&gt;</pre>
<p>Now we are at the mysql&gt; prompt. This is the money. To see the tables type &#8220;show tables&#8221;</p>
<pre class="code">mysql&gt; show tables
    -&gt;</pre>
<p>Hey what&#8217;s with the -&gt;? Remember, you have to end with a semicolon just like in javascript.</p>
<h2>See the tables</h2>
<pre class="code">mysql&gt; show tables;
+-------------------------------------+
| Tables_in_whily_development         |
+-------------------------------------+
| activities                          |
| activities_pairs                    |
...</pre>
<p>Awesome! Now I know all my classes/models/tables in my project.</p>
<h2>View specific tables</h2>
<pre class="code" name="sql">mysql&gt; select * from pairs;
+----+------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------+---------------------+---------------------+---------+
| id | activity_one                                                                                   | activity_two                                                             | created_at          | updated_at          | user_id |
...</pre>
<h2>Select specific columns/objects in your model/table</h2>
<pre class="code">mysql&gt; select user_id from pairs;
+---------+
| user_id |
+---------+
|    NULL |
...</pre>
<h2>Create a column in your table</h2>
<p>Use &#8220;add&#8221; to create columns</p>
<pre class="code">mysql&gt; alter table pairs add category_id int;
Query OK, 29 rows affected (0.01 sec)
Records: 29  Duplicates: 0  Warnings: 0</pre>
<h2>Delete a column in your table</h2>
<p>You use &#8220;drop&#8221; to delete columns in your pairs table</p>
<pre class="code">mysql&gt; alter table pairs drop category_id;
Query OK, 29 rows affected (0.01 sec)
Records: 29  Duplicates: 0  Warnings: 0</pre>
<h2>Delete everything from your table</h2>
<pre class="code">mysql&gt; truncate categories
    -&gt; ;
Query OK, 4 rows affected (0.01 sec)</pre>
<p>So that&#8217;s about it for what I use on a regular basis with mysql. Cheers!</p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.thetruetribe.com%2F2009%2F07%2Fuseful-mysql-commands-with-ruby-on-rails-on-a-mac-or-in-linux%2F&amp;linkname=Useful%20MySQL%20commands%20with%20Ruby%20on%20Rails%20on%20a%20Mac%20or%20in%20Linux"><img src="http://www.thetruetribe.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://www.thetruetribe.com/2009/07/useful-mysql-commands-with-ruby-on-rails-on-a-mac-or-in-linux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
