<?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>Ryan Coughlin &#124; Web and Graphic Designer &#187; Ruby on Rails</title>
	<atom:link href="http://www.ryancoughlin.com/category/ruby-on-rails-tutorials/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.ryancoughlin.com</link>
	<description></description>
	<lastBuildDate>Fri, 26 Mar 2010 00:07:01 +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>Installing Ruby on Rails Plugins via MediaTemple</title>
		<link>http://www.ryancoughlin.com/2009/05/10/installing-ruby-on-rails-plugins-via-mediatemple/</link>
		<comments>http://www.ryancoughlin.com/2009/05/10/installing-ruby-on-rails-plugins-via-mediatemple/#comments</comments>
		<pubDate>Sun, 10 May 2009 12:31:10 +0000</pubDate>
		<dc:creator>Ryan Coughlin</dc:creator>
				<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[media temple]]></category>
		<category><![CDATA[plugins]]></category>
		<category><![CDATA[ruby on rails]]></category>

		<guid isPermaLink="false">http://www.ryancoughlin.com/?p=472</guid>
		<description><![CDATA[Good Morning and Happy Mothers Day!
I have been running Ruby on Rails on my Mac, playing around with applications, getting familiar with the framework. I recently started a Ruby on Rails project for a client and I told the client to switch over to MediaTemple, the best decision ever made. All of the controls and [...]


Related posts:<ol><li><a href='http://www.ryancoughlin.com/2008/11/03/cracking-down-with-ruby-on-rails/' rel='bookmark' title='Permanent Link: Cracking down with Ruby on Rails'>Cracking down with Ruby on Rails</a> <small>So over the weekend I finally sat back down and...</small></li>
<li><a href='http://www.ryancoughlin.com/2008/11/04/validating-with-rails/' rel='bookmark' title='Permanent Link: Validating with Rails'>Validating with Rails</a> <small>Ruby on Rails is one of the more popular MVC...</small></li>
<li><a href='http://www.ryancoughlin.com/2009/05/04/active-record-already-activated/' rel='bookmark' title='Permanent Link: Active Record Already Activated'>Active Record Already Activated</a> <small>After spending hours and hours staring at line after line...</small></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Good Morning and Happy Mothers Day!</p>
<p>I have been running Ruby on Rails on my Mac, playing around with applications, getting familiar with the framework. I recently started a Ruby on Rails project for a client and I told the client to switch over to MediaTemple, the best decision ever made. All of the controls and support are amazing. I was trying to run this command to install Restful Authentication:</p>
<pre lang="text">./script/plugin install git://github.com/technoweenie/restful-authentication.git</pre>
<p>The main issue to make sure to be aware of is to change to your containers directory using this via Terminal:</p>
<pre lang="text">cd $HOME/../../containers</pre>
<p>If you do run:</p>
<pre lang="text">ls</pre>
<p>You should now see a listing of any containers you have purchased in my case mine returns:</p>
<pre lang="text">rails</pre>
<p>Change directories for you are inside your rails application and now run:</p>
<pre lang="text">./script/plugin install git://github.com/technoweenie/restful-authentication.git</pre>
<p>You should be golden! Hope this helps out some people with any issues they may have. I should also add in that the command will generate your controllers/models, best of luck!</p>
<pre lang="text">
./script/generate authenticated user sessions
</pre>


<p>Related posts:<ol><li><a href='http://www.ryancoughlin.com/2008/11/03/cracking-down-with-ruby-on-rails/' rel='bookmark' title='Permanent Link: Cracking down with Ruby on Rails'>Cracking down with Ruby on Rails</a> <small>So over the weekend I finally sat back down and...</small></li>
<li><a href='http://www.ryancoughlin.com/2008/11/04/validating-with-rails/' rel='bookmark' title='Permanent Link: Validating with Rails'>Validating with Rails</a> <small>Ruby on Rails is one of the more popular MVC...</small></li>
<li><a href='http://www.ryancoughlin.com/2009/05/04/active-record-already-activated/' rel='bookmark' title='Permanent Link: Active Record Already Activated'>Active Record Already Activated</a> <small>After spending hours and hours staring at line after line...</small></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.ryancoughlin.com/2009/05/10/installing-ruby-on-rails-plugins-via-mediatemple/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Active Record Already Activated</title>
		<link>http://www.ryancoughlin.com/2009/05/04/active-record-already-activated/</link>
		<comments>http://www.ryancoughlin.com/2009/05/04/active-record-already-activated/#comments</comments>
		<pubDate>Mon, 04 May 2009 05:06:01 +0000</pubDate>
		<dc:creator>Ryan Coughlin</dc:creator>
				<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[active record]]></category>
		<category><![CDATA[mongrel]]></category>
		<category><![CDATA[ruby on rails]]></category>

		<guid isPermaLink="false">http://www.ryancoughlin.com/?p=445</guid>
		<description><![CDATA[After spending hours and hours staring at line after line of SSH into my MediaTemple Ruby On Rails Container, I finally found a solution for this stubborn error that kept developing in my mongrel log on application start:
/home/XXXXX/data/rubygems/lib/rubygems.rb:149:in `activate&#8217;: can&#8217;t activate activerecord (= 2.3.2, runtime), already activated activerecord-2.1.0 (Gem::Exception)
I have tried a whole slew of [...]


Related posts:<ol><li><a href='http://www.ryancoughlin.com/2009/05/10/installing-ruby-on-rails-plugins-via-mediatemple/' rel='bookmark' title='Permanent Link: Installing Ruby on Rails Plugins via MediaTemple'>Installing Ruby on Rails Plugins via MediaTemple</a> <small>Good Morning and Happy Mothers Day! I have been running...</small></li>
<li><a href='http://www.ryancoughlin.com/2008/11/04/validating-with-rails/' rel='bookmark' title='Permanent Link: Validating with Rails'>Validating with Rails</a> <small>Ruby on Rails is one of the more popular MVC...</small></li>
<li><a href='http://www.ryancoughlin.com/2008/11/03/cracking-down-with-ruby-on-rails/' rel='bookmark' title='Permanent Link: Cracking down with Ruby on Rails'>Cracking down with Ruby on Rails</a> <small>So over the weekend I finally sat back down and...</small></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>After spending hours and hours staring at line after line of SSH into my MediaTemple Ruby On Rails Container, I finally found a solution for this stubborn error that kept developing in my mongrel log on application start:</p>
<blockquote><p>/home/XXXXX/data/rubygems/lib/rubygems.rb:149:in `activate&#8217;: can&#8217;t activate activerecord (= 2.3.2, runtime), already activated activerecord-2.1.0 (Gem::Exception)</p></blockquote>
<p>I have tried a whole slew of commands to try and fix this. First, I tried running:</p>
<blockquote><p>gem cleanup</p></blockquote>
<p>Still got that same error when I tried starting my application I made sure that my environment.rb was called the correct version of Rails that I had installed. This command seem to get me in the right direction:</p>
<blockquote><p>rake rails:freeze:gems</p></blockquote>
<p>Before running this, call the following code from your applications root directory:</p>
<blockquote><p>rm -rf vendor/rails/</p></blockquote>
<p>This will remove the folder &#8220;rails&#8221;, then you can continue with running the rake command. After running rake freeze, I got an error, saying it couldn&#8217;t find any rake files. I got this output:</p>
<blockquote><p>Freezing to the gems for Rails 2.3.2<br />
rm -rf vendor/rails<br />
mkdir -p vendor/rails<br />
cd vendor/rails<br />
ERROR:  Gem &#8216;activesupport&#8217; not installed.<br />
mv  activesupport<br />
rm -rf vendor/rails<br />
rake aborted!<br />
undefined method `to_str&#8217; for nil:NilClass</p></blockquote>
<p>Specifying a version to the rake freeze command this work like a charm, I simply ran:</p>
<blockquote><p>rake rails:freeze:edge RELEASE=2.1.2</p></blockquote>
<p>Started my application, checked my mongrel log, no errors on start up. I browsed to my URL and it worked. Hopefully this can help you fix your problem and relieve any headaches. If I missed anything that can help other people out, let me know. The joys of coding continue&#8230;</p>


<p>Related posts:<ol><li><a href='http://www.ryancoughlin.com/2009/05/10/installing-ruby-on-rails-plugins-via-mediatemple/' rel='bookmark' title='Permanent Link: Installing Ruby on Rails Plugins via MediaTemple'>Installing Ruby on Rails Plugins via MediaTemple</a> <small>Good Morning and Happy Mothers Day! I have been running...</small></li>
<li><a href='http://www.ryancoughlin.com/2008/11/04/validating-with-rails/' rel='bookmark' title='Permanent Link: Validating with Rails'>Validating with Rails</a> <small>Ruby on Rails is one of the more popular MVC...</small></li>
<li><a href='http://www.ryancoughlin.com/2008/11/03/cracking-down-with-ruby-on-rails/' rel='bookmark' title='Permanent Link: Cracking down with Ruby on Rails'>Cracking down with Ruby on Rails</a> <small>So over the weekend I finally sat back down and...</small></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.ryancoughlin.com/2009/05/04/active-record-already-activated/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Validating with Rails</title>
		<link>http://www.ryancoughlin.com/2008/11/04/validating-with-rails/</link>
		<comments>http://www.ryancoughlin.com/2008/11/04/validating-with-rails/#comments</comments>
		<pubDate>Tue, 04 Nov 2008 19:38:18 +0000</pubDate>
		<dc:creator>Ryan Coughlin</dc:creator>
				<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[rubyonrails]]></category>
		<category><![CDATA[validation]]></category>

		<guid isPermaLink="false">http://www.ryancoughlin.com/?p=107</guid>
		<description><![CDATA[Ruby on Rails is one of the more popular MVC frameworks out there along with .NET, Zend, and CakePHP. Every day more and more resources are being published regarding Ruby on Rails. One of the nice things about Ruby on Rails is that it makes easy to help validate forms within your rails application. If [...]


Related posts:<ol><li><a href='http://www.ryancoughlin.com/2008/11/03/cracking-down-with-ruby-on-rails/' rel='bookmark' title='Permanent Link: Cracking down with Ruby on Rails'>Cracking down with Ruby on Rails</a> <small>So over the weekend I finally sat back down and...</small></li>
<li><a href='http://www.ryancoughlin.com/2009/05/10/installing-ruby-on-rails-plugins-via-mediatemple/' rel='bookmark' title='Permanent Link: Installing Ruby on Rails Plugins via MediaTemple'>Installing Ruby on Rails Plugins via MediaTemple</a> <small>Good Morning and Happy Mothers Day! I have been running...</small></li>
<li><a href='http://www.ryancoughlin.com/2009/05/04/active-record-already-activated/' rel='bookmark' title='Permanent Link: Active Record Already Activated'>Active Record Already Activated</a> <small>After spending hours and hours staring at line after line...</small></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Ruby on Rails is one of the more popular MVC frameworks out there along with .NET, Zend, and CakePHP. Every day more and more resources are being published regarding Ruby on Rails. One of the nice things about Ruby on Rails is that it makes easy to help validate forms within your rails application. If you want to check for the presence of text for a field it would be something like:</p>
<pre class="ruby" name="code">validates_presence_of :comment</pre>
<p>That checks for the field name comment, like in the code snippet below. This will produce the input tag using rails.</p>
<pre class="ruby" name="code">&lt;%= text_field "comment", "comment" %&gt;</pre>
<p>The other section to make it all run is the</p>
<pre class="ruby" name="code">&lt;%= error_messages_for 'model_name' %&gt;</pre>
<p>Place this line of code at the top of your form, and replace &#8220;model_name&#8221; with the model name your application refers too.  It tells the application to look at the validation rules you set up. Once you have those in place, you should not be able to submit the form with a blank input.</p>
<p>A few other predefined rules built in to Ruby on Rails are:</p>
<p><strong>Field should not be empty</strong></p>
<p><em>Code: validates_presence_of<br />
Example: validates_presence_of :user_name, :password </em></p>
<p><strong>Field should Numerical</strong></p>
<p><em>Code</em><em>: validates_numericality_of<br />
Example: validates_numericality_of :value </em></p>
<p><strong>Field should not be Unique</strong></p>
<p><em>Code</em><em>:validates_uniqueness_of<br />
Example: validates_uniqueness_of :user_name </em></p>
<p><strong>Field Need to be of size X</strong></p>
<p><em>Code</em><em>: validates_length_of<br />
Example: validates_length_of :state_code, :is=&gt;2 </em></p>
<p><strong>Field size Need to be of between X to Y</strong></p>
<p><em>Code</em><em>: validates_length_of<br />
Example: validates_uniqueness_of :user_name</em></p>
<p>To learn more about validation and to read up on the rest of the Rails API, read <a href="http://api.rubyonrails.org/" target="_blank">this</a></p>


<p>Related posts:<ol><li><a href='http://www.ryancoughlin.com/2008/11/03/cracking-down-with-ruby-on-rails/' rel='bookmark' title='Permanent Link: Cracking down with Ruby on Rails'>Cracking down with Ruby on Rails</a> <small>So over the weekend I finally sat back down and...</small></li>
<li><a href='http://www.ryancoughlin.com/2009/05/10/installing-ruby-on-rails-plugins-via-mediatemple/' rel='bookmark' title='Permanent Link: Installing Ruby on Rails Plugins via MediaTemple'>Installing Ruby on Rails Plugins via MediaTemple</a> <small>Good Morning and Happy Mothers Day! I have been running...</small></li>
<li><a href='http://www.ryancoughlin.com/2009/05/04/active-record-already-activated/' rel='bookmark' title='Permanent Link: Active Record Already Activated'>Active Record Already Activated</a> <small>After spending hours and hours staring at line after line...</small></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.ryancoughlin.com/2008/11/04/validating-with-rails/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
