<?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>Designwaves Blog</title>
	<atom:link href="http://blog.designwaves.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.designwaves.com</link>
	<description>Designwaves&#039; technical blog</description>
	<lastBuildDate>Sat, 23 Jul 2011 15:10:18 +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>Ruby on Rails &#8211; Static Pages</title>
		<link>http://blog.designwaves.com/2011/07/23/ruby-on-rails-static-pages/</link>
		<comments>http://blog.designwaves.com/2011/07/23/ruby-on-rails-static-pages/#comments</comments>
		<pubDate>Sat, 23 Jul 2011 15:10:18 +0000</pubDate>
		<dc:creator>Brian</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Rails 3]]></category>
		<category><![CDATA[Ruby on Rails]]></category>

		<guid isPermaLink="false">http://blog.designwaves.com/?p=172</guid>
		<description><![CDATA[I have built an application recently but also wanted to integrated some VERY simple content management system (maybe an inline edit) for static pages on the marketing site.  I saw a bunch of examples on how to do this but nothing really seemed to work for how I wanted to be able to tackle [...]]]></description>
			<content:encoded><![CDATA[<p>I have built an application recently but also wanted to integrated some VERY simple content management system (maybe an inline edit) for static pages on the marketing site.  I saw a bunch of examples on how to do this but nothing really seemed to work for how I wanted to be able to tackle this problem.  For starters, I wanted to be able to use other Rails Content and Models if I needed to display statistics or other Model info.  I wanted to use the CSS and JS Packaging as well as layouts in Rails that I had already built.   I also wanted to make the pages into subfolders for easier updating and organizing in the future, which plays into seo.  Here is what I came up with to solve this issue.  I hope it helps someone else as well&#8230;ENJOY :)</p>
<h3>1) Rails Controller to handle the static page</h3>
<p>This controller seems to be the general catch all for any file in any folder.  The reason I set the path Param is so that we can use that to set the page name on the html body as a class</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#9966CC; font-weight:bold;">class</span> PagesController <span style="color:#006600; font-weight:bold;">&lt;</span> ApplicationController
  respond_to <span style="color:#ff3333; font-weight:bold;">:html</span>
&nbsp;
  <span style="color:#008000; font-style:italic;">#Uncomment if you want cache caches_page :index, :show</span>
&nbsp;
  <span style="color:#9966CC; font-weight:bold;">def</span> index
    <span style="color:#008000; font-style:italic;"># Home Page Only = /</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
  <span style="color:#9966CC; font-weight:bold;">def</span> show
    <span style="color:#0066ff; font-weight:bold;">@path</span> = params<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#ff3333; font-weight:bold;">:path</span><span style="color:#006600; font-weight:bold;">&#93;</span> <span style="color:#008000; font-style:italic;">#Path Param (example /about/faq)</span>
    template = <span style="color:#CC00FF; font-weight:bold;">File</span>.<span style="color:#9900CC;">join</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">'public/pages'</span>, <span style="color:#0066ff; font-weight:bold;">@path</span><span style="color:#006600; font-weight:bold;">&#41;</span>    
    template_with_index = template <span style="color:#006600; font-weight:bold;">+</span> <span style="color:#996600;">&quot;/index&quot;</span>  
    render <span style="color:#ff3333; font-weight:bold;">:template</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> template  <span style="color:#008000; font-style:italic;">#Normal File</span>
    <span style="color:#9966CC; font-weight:bold;">rescue</span> 
         render <span style="color:#ff3333; font-weight:bold;">:template</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> template_with_index  <span style="color:#008000; font-style:italic;">#if you had an index.html.erb file under a subfolder</span>
    <span style="color:#9966CC; font-weight:bold;">rescue</span> 
         redirect_to <span style="color:#996600;">&quot;/404.html&quot;</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
<span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>

<h3>2) Route</h3>
<p>The route is a catch-all style route to be put after all other routes are listed</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;">      resources <span style="color:#ff3333; font-weight:bold;">:pages</span>, <span style="color:#ff3333; font-weight:bold;">:only</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#ff3333; font-weight:bold;">:index</span>, <span style="color:#ff3333; font-weight:bold;">:show</span><span style="color:#006600; font-weight:bold;">&#93;</span>
      match <span style="color:#996600;">'*path'</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">'pages#show'</span>
      root <span style="color:#ff3333; font-weight:bold;">:to</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">'pages#index'</span></pre></div></div>

<h3>3) The Views and Layout</h3>
<p>The updates to the views and layouts were to provide an easier way to write css</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;body class=&quot;&lt;%= page_name %&gt;&quot;&gt;</pre></div></div>

<h3>3) The Helpers</h3>
<p>page_name is a helper method which will generate a variable based on the path params</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#9966CC; font-weight:bold;">module</span> ApplicationHelper
&nbsp;
  <span style="color:#9966CC; font-weight:bold;">def</span> page_name
    <span style="color:#0066ff; font-weight:bold;">@path</span>.<span style="color:#9900CC;">parameterize</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">'_'</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#9966CC; font-weight:bold;">unless</span> <span style="color:#0066ff; font-weight:bold;">@path</span>.<span style="color:#9900CC;">blank</span>?
  <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
<span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>

<p>I felt this simple implement allows me to utilize all the beauty of Rails but doesn&#8217;t limit me to having to use public/*.html files, which isn&#8217;t easy to use when you already have layouts and styles.  I thought about using some different gems to handle this but most seemed a bit overkill for what I wanted to do and this method was easier for me, in my opinion.  I hope this helps someone else that is considering doing something like this as well.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.designwaves.com/2011/07/23/ruby-on-rails-static-pages/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ruby on Rails &#8211; Easy date display</title>
		<link>http://blog.designwaves.com/2010/11/19/ruby-on-rails-easy-date-display/</link>
		<comments>http://blog.designwaves.com/2010/11/19/ruby-on-rails-easy-date-display/#comments</comments>
		<pubDate>Sat, 20 Nov 2010 03:06:57 +0000</pubDate>
		<dc:creator>Brian</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Rails 3]]></category>
		<category><![CDATA[Ruby on Rails]]></category>

		<guid isPermaLink="false">http://blog.designwaves.com/?p=162</guid>
		<description><![CDATA[I have created this simple format_date method to format dates differently and put it in the ApplicationHelper.  I know it isn&#8217;t something that is a super WOW factor but thought I would share anyways.

  def format_date&#40;type, date&#41;
    case type
      when :short_no_year 
    [...]]]></description>
			<content:encoded><![CDATA[<p>I have created this simple format_date method to format dates differently and put it in the ApplicationHelper.  I know it isn&#8217;t something that is a super WOW factor but thought I would share anyways.</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;">  <span style="color:#9966CC; font-weight:bold;">def</span> format_date<span style="color:#006600; font-weight:bold;">&#40;</span>type, date<span style="color:#006600; font-weight:bold;">&#41;</span>
    <span style="color:#9966CC; font-weight:bold;">case</span> type
      <span style="color:#9966CC; font-weight:bold;">when</span> <span style="color:#ff3333; font-weight:bold;">:short_no_year</span> 
        date.<span style="color:#9900CC;">strftime</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;%b %d&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
      <span style="color:#9966CC; font-weight:bold;">when</span> <span style="color:#ff3333; font-weight:bold;">:short</span>
        date.<span style="color:#9900CC;">strftime</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;%b %d, %y&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
      <span style="color:#9966CC; font-weight:bold;">when</span> <span style="color:#ff3333; font-weight:bold;">:long</span> 
        date.<span style="color:#9900CC;">strftime</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;%B %d, %Y&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
      <span style="color:#9966CC; font-weight:bold;">when</span> <span style="color:#ff3333; font-weight:bold;">:long_day_of_week</span>
        date.<span style="color:#9900CC;">strftime</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;%a %B %d, %Y&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
      <span style="color:#9966CC; font-weight:bold;">when</span> <span style="color:#ff3333; font-weight:bold;">:default</span>
        date.<span style="color:#9900CC;">strftime</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;%m.%d.%Y&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
    <span style="color:#9966CC; font-weight:bold;">end</span>
  <span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>

<p>to call in your view just use</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#006600; font-weight:bold;">&lt;%</span>=format_date<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#ff3333; font-weight:bold;">:long</span>, crappy_date_from_db<span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">%&gt;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://blog.designwaves.com/2010/11/19/ruby-on-rails-easy-date-display/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Ruby on Rails &#8211; Easy Navigation</title>
		<link>http://blog.designwaves.com/2010/11/19/ruby-on-rails-easy-navigation/</link>
		<comments>http://blog.designwaves.com/2010/11/19/ruby-on-rails-easy-navigation/#comments</comments>
		<pubDate>Sat, 20 Nov 2010 03:04:01 +0000</pubDate>
		<dc:creator>Brian</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Rails 3]]></category>
		<category><![CDATA[Ruby on Rails]]></category>

		<guid isPermaLink="false">http://blog.designwaves.com/?p=156</guid>
		<description><![CDATA[This is primarily going to be a repost to some extent but would like to add a piece that I think will help even more.  Based on http://www.cuberick.com/2010/05/simple-tabbed-navigation-in-rails.html  I have added a simple regex that I think will help with the current status and be flexible to change on the fly if rules [...]]]></description>
			<content:encoded><![CDATA[<p>This is primarily going to be a repost to some extent but would like to add a piece that I think will help even more.  Based on <a href="http://www.cuberick.com/2010/05/simple-tabbed-navigation-in-rails.html">http://www.cuberick.com/2010/05/simple-tabbed-navigation-in-rails.html</a>  I have added a simple regex that I think will help with the current status and be flexible to change on the fly if rules change.</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;">&lt;ul&gt;
&lt;li class=&quot;<span style="color:#006600; font-weight:bold;">&lt;%</span>= selected_navigation<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#ff3333; font-weight:bold;">:items</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">%&gt;</span>&quot;&gt;<span style="color:#006600; font-weight:bold;">&lt;%</span>= link_to <span style="color:#996600;">&quot;Items&quot;</span>, items_path <span style="color:#006600; font-weight:bold;">%&gt;</span>&lt;/li&gt;
&lt;li class=&quot;<span style="color:#006600; font-weight:bold;">&lt;%</span>= selected_navigation<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#ff3333; font-weight:bold;">:things</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">%&gt;</span>&quot;&gt;<span style="color:#006600; font-weight:bold;">&lt;%</span>= link_to <span style="color:#996600;">&quot;Things&quot;</span>, things_path <span style="color:#006600; font-weight:bold;">%&gt;</span>&lt;/li&gt;
&lt;/ul&gt;</pre></div></div>

<p>and then add in the ApplicationHelper this simple code</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;">  <span style="color:#9966CC; font-weight:bold;">def</span> selected_navigation<span style="color:#006600; font-weight:bold;">&#40;</span>element<span style="color:#006600; font-weight:bold;">&#41;</span>
    request.<span style="color:#9900CC;">fullpath</span> =~ <span style="color:#006600; font-weight:bold;">/</span>\<span style="color:#006600; font-weight:bold;">/</span><span style="color:#008000; font-style:italic;">#{element.to_s}/ ? &quot;current&quot; : &quot;&quot;</span>
  <span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://blog.designwaves.com/2010/11/19/ruby-on-rails-easy-navigation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>10 Favorite jQuery Tutorials and Plugins</title>
		<link>http://blog.designwaves.com/2010/06/30/10-favorite-jquery-tutorials-and-plugins/</link>
		<comments>http://blog.designwaves.com/2010/06/30/10-favorite-jquery-tutorials-and-plugins/#comments</comments>
		<pubDate>Wed, 30 Jun 2010 17:29:17 +0000</pubDate>
		<dc:creator>Brian</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[jQuery Plugins]]></category>
		<category><![CDATA[jQuery Tutorials]]></category>

		<guid isPermaLink="false">http://blog.designwaves.com/?p=113</guid>
		<description><![CDATA[I thought it would be appropriate to list out a handful of jQuery samples and plugins that are our favorite to use.  jQuery is one of the most innovative javascript frameworks available today and we love to use it extensively on our projects, for ourselves and our clients.  Here is a small list [...]]]></description>
			<content:encoded><![CDATA[<p>I thought it would be appropriate to list out a handful of jQuery samples and plugins that are our favorite to use.  jQuery is one of the most innovative javascript frameworks available today and we love to use it extensively on our projects, for ourselves and our clients.  Here is a small list of samples and plugins that we love and we feel you will as well.</p>
<h3>1) <a href="http://www.learningjquery.com/2009/02/slide-elements-in-different-directions">Slide Elements in Different Directions</a></h3>
<p>A wonderful tutorial on how to make elements move on the page based on actions that you have performed. <a href="http://www.learningjquery.com/2009/02/slide-elements-in-different-directions">View Tutorial</a></p>
<h3>2) <a href="http://jquery.malsup.com/form/">jQuery Form Plugin</a></h3>
<p>An excellent plugin that will easily allow you to submit your forms using jQuery and Ajax. <a href="http://jquery.malsup.com/form/">View Plugin</a></p>
<h3>3) <a href="http://net.tutsplus.com/tutorials/javascript-ajax/submit-a-form-without-page-refresh-using-jquery/">Submit a form without Page Refresh</a></h3>
<p>Another excellent forms tutorial that describes how easy it is to submit forms with simple javascript and html. <a href="http://net.tutsplus.com/tutorials/javascript-ajax/submit-a-form-without-page-refresh-using-jquery/">View Tutorial</a></p>
<h3>4) <a href="http://blue-anvil.com/jquerycurvycorners/test.html">JQuery Curvy Corners</a></h3>
<p>A nice script to turn elements into curvy corners.  Until CSS3 is fully implements with border-radius, this is a fantastic alternative.  <a href="http://blue-anvil.com/jquerycurvycorners/test.html">View Plugin</a></p>
<p><a href="http://blog.designwaves.com/wp-content/uploads/2010/06/curvy-corners-example.png"><img src="http://blog.designwaves.com/wp-content/uploads/2010/06/curvy-corners-example.png" alt="" title="curvy-corners-example" width="631" height="145" class="aligncenter size-full wp-image-127" /></a></p>
<h3>5) <a href="http://www.position-absolute.com/articles/jquery-form-validator-because-form-validation-is-a-mess/">JQuery Form Validation</a></h3>
<p>Form validation is one of the biggest wastes of time to code from scratch, but is needed.  It is much better to validate on the front end rather than submitting to the backend to minimize load on the server.  This plugin is one the coolest and best I have seen.  It is extremely easy to implement for any or all fields on your forms.  <a href="http://www.position-absolute.com/articles/jquery-form-validator-because-form-validation-is-a-mess/">View Plugin</a></p>
<p><a href="http://blog.designwaves.com/wp-content/uploads/2010/06/form-validation-example1.png"><img src="http://blog.designwaves.com/wp-content/uploads/2010/06/form-validation-example1-300x128.png" alt="" title="form-validation-example" width="300" height="128" class="aligncenter size-medium wp-image-134" /></a></p>
<h3>6) <a href="http://jqueryui.com/themeroller/">JQuery UI Theme Roller</a></h3>
<p>Even when using javascript libraries and plugins sometimes it can be very time consuming to add your own styles and themes.  With the JQuery UI Theme Roller, it makes using the UI library much easier to integrate in your style to use common UI components.<a href="http://jqueryui.com/themeroller/">View Tutorial</a></p>
<p><a href="http://blog.designwaves.com/wp-content/uploads/2010/06/jquery-theme-roller.png"><img src="http://blog.designwaves.com/wp-content/uploads/2010/06/jquery-theme-roller.png" alt="" title="jquery-theme-roller" width="223" height="419" class="aligncenter size-full wp-image-131" /></a></p>
<h3>7) <a href="http://fancybox.net/">Fancybox</a></h3>
<p>If you are looking for a nice clean looking popup for displaying video, images, flash, etc.  Then Fancybox could be what you are looking to use.  This is one of the nicest and cleanest we have seen, and implementation is a breeze.<a href="http://fancybox.net/">View Plugin</a></p>
<p><a href="http://blog.designwaves.com/wp-content/uploads/2010/06/fancybox-example.png"><img src="http://blog.designwaves.com/wp-content/uploads/2010/06/fancybox-example-300x207.png" alt="" title="fancybox-example" width="300" height="207" class="aligncenter size-medium wp-image-139" /></a></p>
<h3>8) <a href="http://web-kreation.com/demos/Sliding_login_panel_jquery/">Sliding Login Panel</a></h3>
<p>A login panel can be really nice when it is hidden and only shown when you click the login button or link.  In this example, it will show you how to implement a hidden panel that will slide down from the top of the page so you can get back some real estate on your page&#8217;s layout.<a href="http://web-kreation.com/demos/Sliding_login_panel_jquery/">View Tutorial</a></p>
<p><a href="http://blog.designwaves.com/wp-content/uploads/2010/06/sliding-login-example.png"><img src="http://blog.designwaves.com/wp-content/uploads/2010/06/sliding-login-example-1024x264.png" alt="" title="sliding-login-example" width="450" height="116" class="aligncenter size-large wp-image-136" /></a></p>
<h3>9) <a href="http://jqueryfordesigners.com/coda-popup-bubbles/">Popup Bubble</a></h3>
<p>I have seen sites like <a href="http://www.panic.com/coda/">Panic&#8217;s Coda</a> where they have a really nice popup bubble when you hover over the downloads.  I knew jQuery would make this very easy to do but found a tutorial that already explains how to do this.<a href="http://jqueryfordesigners.com/coda-popup-bubbles/">View Tutorial</a></p>
<p><a href="http://blog.designwaves.com/wp-content/uploads/2010/06/bubble-example.png"><img src="http://blog.designwaves.com/wp-content/uploads/2010/06/bubble-example.png" alt="" title="bubble-example" width="179" height="176" class="aligncenter size-full wp-image-140" /></a></p>
<h3>10) <a href="http://www.sohtanaka.com/web-design/mega-drop-downs-w-css-jquery/">Mega Drop Down Menus w/ CSS &amp; jQuery</a></h3>
<p>A really awesome tutorial on how to build a super clean drop down box as your menu bar.<a href="http://www.sohtanaka.com/web-design/mega-drop-downs-w-css-jquery/">View Plugin</a></p>
<p><a href="http://blog.designwaves.com/wp-content/uploads/2010/06/drop-down-example1.png"><img src="http://blog.designwaves.com/wp-content/uploads/2010/06/drop-down-example1-300x144.png" alt="" title="drop-down-example" width="300" height="144" class="aligncenter size-medium wp-image-141" /></a></p>
<p>OK OK, I know I said 10 of our favorites but I had to add one more to the list.  </p>
<h3>11)<a href="http://coda.co.za/blog/2008/10/26/jquery-plugin-for-twitter">Twitter Feeds with jQuery</a>. </h3>
<p>This has been one of the easier plugins to implement with jquery and love the way it integrates into Twitter. <a href="http://coda.co.za/blog/2008/10/26/jquery-plugin-for-twitter">View Plugin</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.designwaves.com/2010/06/30/10-favorite-jquery-tutorials-and-plugins/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Configure Ruby on Rails, MacPorts and Apache Passenger &#8211; Development Environment</title>
		<link>http://blog.designwaves.com/2010/06/17/configure-ruby-on-rails-macports-and-apache-passenger-development-environment/</link>
		<comments>http://blog.designwaves.com/2010/06/17/configure-ruby-on-rails-macports-and-apache-passenger-development-environment/#comments</comments>
		<pubDate>Thu, 17 Jun 2010 22:18:57 +0000</pubDate>
		<dc:creator>Brian</dc:creator>
				<category><![CDATA[Configuration]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[Mac OSX]]></category>
		<category><![CDATA[MacPorts]]></category>
		<category><![CDATA[Ruby on Rails]]></category>

		<guid isPermaLink="false">http://blog.designwaves.com/?p=72</guid>
		<description><![CDATA[I started out by reading a bunch of articles on how to effectively set up a development environment on my Mac with Ruby on Rails, MacPorts and Apache Passenger.  I started to find there were many different approaches on how to do this.  I&#8217;m currently running MAMP for the development of websites for [...]]]></description>
			<content:encoded><![CDATA[<p>I started out by reading a bunch of articles on how to effectively set up a development environment on my Mac with Ruby on Rails, MacPorts and Apache Passenger.  I started to find there were many different approaches on how to do this.  I&#8217;m currently running MAMP for the development of websites for my clients, but couldn&#8217;t find the best approach for adding Ruby on Rails to my MAMP server.  I tried a few different ideas but could never get the MAMP install to work with Ruby on Rails so I decided to set up MacPorts to a different ports (81) and run MAMP for PHP based web applications.  I thought I would share my experience on how to set it up nicely on the mac running both ports 80 and 81 for different types of applications.  Here&#8217;s how I did it!</p>
<h3>1) Install MacPorts</h3>
<p>Here are the instructions <a href="http://www.macports.org/install.php">http://www.macports.org/install.php</a></p>
<h3>2) Install Apache using MacPorts</h3>

<div class="wp_syntax"><div class="code"><pre class="teraterm" style="font-family:monospace;">$sudo port install apache2</pre></div></div>

<p>You could decide to install MySQL, Subversion, Git, etc but for now those aren&#8217;t 100% important to getting up and running.</p>
<h3>3) Update your user&#8217;s .profile</h3>
<p>Update the export PATH with the apache2 line</p>

<div class="wp_syntax"><div class="code"><pre class="teraterm" style="font-family:monospace;">export PATH<span style="color: #ff00ff; font-weight: bold;">=/</span>opt<span style="color: #ff00ff; font-weight: bold;">/</span>local<span style="color: #ff00ff; font-weight: bold;">/</span>bin:<span style="color: #ff00ff; font-weight: bold;">/</span>opt<span style="color: #ff00ff; font-weight: bold;">/</span>local<span style="color: #ff00ff; font-weight: bold;">/</span>sbin:<span style="color: #ff00ff; font-weight: bold;">/</span>opt<span style="color: #ff00ff; font-weight: bold;">/</span>local<span style="color: #ff00ff; font-weight: bold;">/</span>apache2<span style="color: #ff00ff; font-weight: bold;">/</span>bin:$PATH</pre></div></div>

<p>Now we have a base Apache install with the path pointing to the Apache installed under MacPorts.  You can run kick off the server and test it out at localhost.</p>

<div class="wp_syntax"><div class="code"><pre class="teraterm" style="font-family:monospace;">$sudo apachectl <span style="color: #ff00ff; font-weight: bold;">-</span>k start</pre></div></div>

<h3>4) Install the Ruby Components using MacPorts</h3>

<div class="wp_syntax"><div class="code"><pre class="teraterm" style="font-family:monospace;">$sudo port install ruby
$sudo port install rb<span style="color: #ff00ff; font-weight: bold;">-</span>rubygems</pre></div></div>

<h3>5) Install Ruby Gems</h3>

<div class="wp_syntax"><div class="code"><pre class="teraterm" style="font-family:monospace;">$sudo gem install rails
$sudo gem install rake
$sudo gem install sqlite3<span style="color: #ff00ff; font-weight: bold;">-</span>ruby
$sudo gem install mongrel</pre></div></div>

<p>At this point, you should be able to go to the command line and type in and an application will be generated for you in a test app directory.</p>

<div class="wp_syntax"><div class="code"><pre class="teraterm" style="font-family:monospace;">$rails testapp</pre></div></div>

<p>If you cd into the testapp directory and type in</p>

<div class="wp_syntax"><div class="code"><pre class="teraterm" style="font-family:monospace;">$script<span style="color: #ff00ff; font-weight: bold;">/</span>server</pre></div></div>

<p>and you should see this<br />
=> Booting Mongrel<br />
=> Rails 2.3.5 application starting on http://0.0.0.0:3000<br />
=> Call with -d to detach<br />
=> Ctrl-C to shutdown server</p>
<p>At this point you are not using apache, you are using the server that comes with the Rails Framework.  It proves everything is installed correctly at this point and you can hit Ctrl-C to shutdown the server. Next,</p>
<h3>6) Install Passenger Phusion</h3>

<div class="wp_syntax"><div class="code"><pre class="teraterm" style="font-family:monospace;">$sudo gem install passenger</pre></div></div>

<h3>7) Install Apache Passenger</h3>

<div class="wp_syntax"><div class="code"><pre class="teraterm" style="font-family:monospace;">$sudo passenger<span style="color: #ff00ff; font-weight: bold;">-</span>install<span style="color: #ff00ff; font-weight: bold;">-</span>apache2<span style="color: #ff00ff; font-weight: bold;">-</span>module</pre></div></div>

<h3>8) Install Passenger Preference Pane</h3>
<p>Now we have everything installed but the biggest issue we have now is how do you add the Ruby on Rails applications to the Apache Passenger installation.  Well, thankfully there is a <a href="http://www.fngtps.com/2009/09/new-os-more-pane-passenger-preference-pane-v1-3">Mac Preference Pane</a> that can be added to help add your applications quickly to Apache. </p>
<p><a href="http://blog.designwaves.com/wp-content/uploads/2010/06/Passenger-32-bit-e1276829119806.png"><img src="http://blog.designwaves.com/wp-content/uploads/2010/06/Passenger-32-bit-e1276829119806.png" alt="" title="Passenger (32-bit)" width="650" height="488" class="aligncenter size-full wp-image-109" /></a></p>
<p>Once you have installed the preference panel, you should be able to drag the testapp folder from above to the panel and it will automatically add the correct configuration to the apache server.  Just for good measure, restart apache ($sudo apachectl -k restart) and you should be able to hit http://testapp.local/ and your ruby on rails application will show up.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.designwaves.com/2010/06/17/configure-ruby-on-rails-macports-and-apache-passenger-development-environment/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Welcome to Designwaves and Our Blog!</title>
		<link>http://blog.designwaves.com/2010/06/06/welcome-to-designwaves-and-our-blog/</link>
		<comments>http://blog.designwaves.com/2010/06/06/welcome-to-designwaves-and-our-blog/#comments</comments>
		<pubDate>Mon, 07 Jun 2010 03:16:59 +0000</pubDate>
		<dc:creator>Brian</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://blog.designwaves.com/?p=28</guid>
		<description><![CDATA[Today is the big release of our new cutting-edge technology company, based in Raleigh, NC, that specializes in Website Design and Development, Social Media Integration, Cloud Solutions, eCommerce, and Content Management Systems (We provide a whole bunch of other exciting services too, but you’ll have to check out the site to get the full Overview). [...]]]></description>
			<content:encoded><![CDATA[<p>Today is the big release of our new cutting-edge technology company, based in Raleigh, NC, that specializes in <a href="http://www.designwaves.com/services/design/#web_design">Website Design</a> and <a href="http://www.designwaves.com/services/design/#web_development">Development</a>, <a href="http://www.designwaves.com/services/social_media/">Social Media Integration</a>, <a href="http://www.designwaves.com/services/hosting_solutions/#cloud">Cloud Solutions</a>, <a href="http://www.designwaves.com/services/development/#ecommerce">eCommerce</a>, and <a href="http://www.designwaves.com/services/development/#content_management_systems">Content Management Systems</a> (We provide a whole bunch of other exciting services too, but you’ll have to check out the site to get the full <a href="http://www.designwaves.com/services/">Overview</a>).  Although today is our big day, I&#8217;m sure more people are excited about the new iPhone release than ours&#8230; well actually we&#8217;re pretty fired up about the new iPhone too!</p>
<p>Our team will utilize the blog to provide new and exciting educational content of how-to&#8217;s, innovative information, and helpful hints and tips.  I hope that you will find our Blog an excellent technical resource that will be an asset to your company or your technical needs.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.designwaves.com/2010/06/06/welcome-to-designwaves-and-our-blog/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

