<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:ymaps="http://api.maps.yahoo.com/Maps/V2/AnnotatedMaps.xsd">

<channel>
	<title>The Codebelay Blog &#187; ruby on rails</title>
	<atom:link href="http://www.codebelay.com/blog/category/ruby-on-rails/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.codebelay.com/blog</link>
	<description>Safely Reach New Tech Heights Through Our Startup Insights</description>
	<lastBuildDate>Wed, 25 Jan 2012 19:12:53 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Upgrade Your Rails Facebook App to SSL</title>
		<link>http://www.codebelay.com/blog/2011/09/13/upgrade-your-rails-facebook-app-to-ssl/</link>
		<comments>http://www.codebelay.com/blog/2011/09/13/upgrade-your-rails-facebook-app-to-ssl/#comments</comments>
		<pubDate>Wed, 14 Sep 2011 05:39:27 +0000</pubDate>
		<dc:creator>barce</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[How-To]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[ruby on rails]]></category>
		<category><![CDATA[WebApps]]></category>
		<category><![CDATA[facebook]]></category>
		<category><![CDATA[facebook apps]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[ssl]]></category>

		<guid isPermaLink="false">http://www.codebelay.com/blog/?p=1159</guid>
		<description><![CDATA[On October 1st of this year, Facebook will be requiring that all apps on Facebook must support HTTPS (SSL). I&#8217;ve provided a guide below which I&#8217;ve used for apps I&#8217;ve worked on that are Rails based. This guide shows you how to change your Rails Facebook App into an app that supports SSL using Passenger [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>On October 1st of this year, <a href="https://developers.facebook.com/blog/post/499/">Facebook will be requiring that all apps on Facebook must support HTTPS (SSL)</a>.</p>
<p>I&#8217;ve provided a guide below which I&#8217;ve used for apps I&#8217;ve worked on that are Rails based. </p>
<p>This guide shows you how to change your Rails Facebook App into an app that supports SSL using <a href="http://www.modrails.com/index.html">Passenger</a> and Apache2.</p>
<p><strong>Step 1: Get an SSL cert or roll your own.<br />
</strong></p>
<p><a href="http://www.dreamhost.com/">Dreamhost.com</a> made it very easy to add an SSL cert for just $15.00 / year.</p>
<p>I tried out my app out using a locally signed certificate which seemed to work just fine:</p>
<div style="padding: 5px; color: #fff; background: #000">
openssl genrsa -des3 -out server.key 2048<br />
openssl req -new -key server.key -out server.csr<br />
cp server.key server.key.org<br />
openssl rsa -in server.key.org -out server.key<br />
openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt
</div>
<p><br/><br />
<strong>Step 2: Install and compile Apache 2<br />
</strong><br />
Get the latest version of Apache: <a href="http://httpd.apache.org/download.cgi">http://httpd.apache.org/download.cgi</a>.</p>
<p>Configure and compile Apache:<br />
./configure &#8211;prefix=/usr/local/apache2 &#8211;enable-rewrite &#8211;enable-so &#8211;enable-ssl<br />
make &#038;&#038; make install</p>
<p><strong>Step 3: Configure your Rails app<br />
</strong><br />
gem install passenger<br />
passenger-install-apache2-module</p>
<p><strong>Step 4: Edit your Apache 2 config files:<br />
</strong><br />
Edit httpd.conf. For example:</p>
<div style="padding: 5px; color: #fff; background: #000">
<pre style="color: #fff; background: #000;">
LoadModule fcgid_module modules/mod_fcgid.so
LoadModule passenger_module /Users/jimbarcelona/.rvm/gems/ruby-1.9.2-p290/gems/passenger-3.0.8/ext/apache2/mod_passenger.so
PassengerRoot /Users/jimbarcelona/.rvm/gems/ruby-1.9.2-p290/gems/passenger-3.0.8
PassengerRuby /Users/jimbarcelona/.rvm/wrappers/ruby-1.9.2-p290/ruby

<Directory "/Users/jimbarcelona/rails_apps">
    Options Indexes FollowSymLinks
    AllowOverride All
    Order allow,deny
    Allow from all
</Directory>

Include conf/extra/httpd-vhosts.conf
Include conf/extra/httpd-ssl.conf

<IfModule mod_fcgid.c>
IPCCommTimeout 40
IPCConnectTimeout 10

# TODO: change this to production if you are on production
DefaultInitEnv RAILS_ENV development
SocketPath /tmp/fcgidsock
</IfModule>
</pre>
</div>
<p><br/></p>
<p>Edit extra/httpd-vhosts.conf:</p>
<div style="padding: 5px; color: #fff; background: #000">
<pre style="color: #fff; background: #000;">
<VirtualHost *:80>
  ServerName berkeley.l33tcave.com
  ServerAdmin wwwadmin@berkeley.l33tcave.com
  DocumentRoot /Users/jimbarcelona/rails_apps/github/hipsterhookups.com/public
  ErrorLog /usr/local/apache2/logs/rails_error_log
  RewriteEngine On
  <Directory /Users/jimbarcelona/rails_apps/github/hipsterhookups.com/public>
    AllowOverride All
    Options -MultiViews
  </Directory>
  RailsEnv development
</VirtualHost>
</pre>
</div>
<p><br/></p>
<p>Edit extra/httpd-ssl.conf:</p>
<div style="padding: 5px; color: #fff; background: #000">
<pre style="color: #fff; background: #000;">
#   General setup for the virtual host
DocumentRoot "/Users/jimbarcelona/rails_apps/github/hipsterhookups.com/public"
ServerName berkeley.l33tcave.com:443
ServerAdmin you@example.com
ErrorLog "/usr/local/apache2/logs/error_log"
TransferLog "/usr/local/apache2/logs/access_log"

# needed for rails
Options Indexes ExecCGI FollowSymLinks
RewriteEngine On
RailsEnv development

AddHandler fcgid-script .fcgi

  <Directory /Users/jimbarcelona/rails_apps/github/hipsterhookups.com/public>
    AllowOverride All
    Options -MultiViews
  </Directory>
</pre>
</div>
<p><br/><br />
Be sure to add your SSL certs in the httpd-ssl.conf too!</p>
<p><strong>Step 5: Start Apache<br />
</strong></p>
<p># check syntax<br />
apachectl configtest<br />
# start apache<br />
apachectl start</p>
<p><strong>Step 6:</strong> Go to facebook and use https for canvas URLs</p>
]]></content:encoded>
			<wfw:commentRss>http://www.codebelay.com/blog/2011/09/13/upgrade-your-rails-facebook-app-to-ssl/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Upgrading To Rails 3</title>
		<link>http://www.codebelay.com/blog/2011/01/06/upgrading-to-rails-3/</link>
		<comments>http://www.codebelay.com/blog/2011/01/06/upgrading-to-rails-3/#comments</comments>
		<pubDate>Fri, 07 Jan 2011 00:40:28 +0000</pubDate>
		<dc:creator>barce</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[ruby on rails]]></category>

		<guid isPermaLink="false">http://www.codebelay.com/blog/?p=996</guid>
		<description><![CDATA[Here&#8217;s how I upgraded Sitebeagle.net to Rails 3. 1. Go into your site&#8217;s Rails directory and install rails_upgrade: script/plugin install git://github.com/rails/rails_upgrade.git Run the following commands and follow the instructions: rake rails:upgrade:check rake rails:upgrade:backup rake rails:upgrade:routes rake rails:upgrade:gems rake rails:upgrade:configuration 2. Make sure that your version of Ruby 1.9+ has iconv working. Mine didn&#8217;t, so I [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>Here&#8217;s how I upgraded <a href="http://sitebeagle.net/">Sitebeagle.net</a> to Rails 3.</p>
<p>1. Go into your site&#8217;s Rails directory and install rails_upgrade:</p>
<p>script/plugin install git://github.com/rails/rails_upgrade.git</p>
<p>Run the following commands and follow the instructions:</p>
<p>rake rails:upgrade:check<br />
rake rails:upgrade:backup<br />
rake rails:upgrade:routes<br />
rake rails:upgrade:gems<br />
rake rails:upgrade:configuration</p>
<p>2. Make sure that your version of Ruby 1.9+ has iconv working.</p>
<p>Mine didn&#8217;t, so I went through this process:</p>
<p>rvm package install readline<br />
rvm package install iconv<br />
rvm remove 1.9.2<br />
rvm install &#8211;trace 1.9.2 -C &#8211;with-iconv-dir=$HOME/.rvm/usr</p>
<p>to test:<br />
irb<br />
require &#8216;iconv&#8217; # should return true</p>
<p>3. Upgrade to Rails 3: gem install rails</p>
<p>4. Start migrating to Rails 3: I branched my site using git and went into my Rails root directory and typed:</p>
<p>rails `pwd`</p>
<p>Use your best judgment on what can and cannot be over-written. Here&#8217;s my list:</p>
<p>* let rails overwrite?<br />
* overwrite rake file<br />
* overwrite application_controller.rb? yes but copy<br />
* application_helper.rb ? yes<br />
* routes.rb ? yes but copy<br />
* environment.rb ?<br />
* make new initializer for contants<br />
* config.gem? copy and put into a Gemfile<br />
* application.js ? only if confident in js<br />
* scripts? overwrite all</p>
<p>5. See if stuff works:</p>
<p>rails server</p>
<p>Twitter-auth broke for me, so I had to update it to work on Rails 3 using this guide:</p>
<p><a href="https://github.com/benders/twitter-auth/compare/master...rails_3">https://github.com/benders/twitter-auth/compare/master&#8230;rails_3</a></p>
<p>How&#8217;s your upgrade to Rails 3 go? Let me know in the comments below.</p>
<p><strong>Update (14 January 2011):</strong></p>
<p><a href="http://chrislaco.com/">Chris Laco</a> wrote up this great guide to u<a href="http://chrislaco.com/blog/rails3-dreamhost-and-you/">pgrading Rails 3 on Dreamhost</a>. It solves path problem issues with gems.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.codebelay.com/blog/2011/01/06/upgrading-to-rails-3/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Redboxing with Rails: Modal Windows FTW</title>
		<link>http://www.codebelay.com/blog/2008/11/01/redboxing-with-rails-modal-windows-ftw/</link>
		<comments>http://www.codebelay.com/blog/2008/11/01/redboxing-with-rails-modal-windows-ftw/#comments</comments>
		<pubDate>Sat, 01 Nov 2008 22:59:31 +0000</pubDate>
		<dc:creator>barce</dc:creator>
				<category><![CDATA[How-To]]></category>
		<category><![CDATA[ruby on rails]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[modal windows]]></category>
		<category><![CDATA[redbox plugin]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://www.codebelay.com/blog/?p=350</guid>
		<description><![CDATA[There&#8217;s a great lightbox plugin for Ruby on Rails called Redbox. Unfortunately, it doesn&#8217;t work out of the box, but here&#8217;s the patch for redbox.js: Replace: Element.setTop(window_id, boxTop); Element.setLeft(window_id, boxLeft); With: $(window_id).style.top = boxTop + &#8220;px&#8221;; $(window_id).style.left = boxLeft + &#8220;px&#8221;; Remove or comment out: Element.hide(&#8216;RB_loading&#8217;); Remove: &#60;div id=&#8221;RB_loading&#8221;&#62;&#60;/div&#62;]]></description>
			<content:encoded><![CDATA[<p></p><p>There&#8217;s a great lightbox plugin for Ruby on Rails called <a href="http://blog.craigambrose.com/past/2006/8/16/redbox-a-rails-compatible-lightbox/">Redbox</a>. Unfortunately, it doesn&#8217;t work out of the box, but here&#8217;s the <a href="redbox_patch.dif">patch</a> for redbox.js:</p>
<p>Replace:</p>
<div style="background: #000; color: #fff; padding: 10px;">
                Element.setTop(window_id, boxTop);<br />
                Element.setLeft(window_id, boxLeft);
</div>
<p>With:</p>
<div style="background: #000; color: #fff; padding: 10px;">
    $(window_id).style.top = boxTop + &#8220;px&#8221;;<br />
    $(window_id).style.left = boxLeft + &#8220;px&#8221;;
</div>
<p>Remove or comment out:</p>
<div style="background: #000; color: #fff; padding: 10px;">
Element.hide(&#8216;RB_loading&#8217;);
</div>
<p>Remove:</p>
<div style="background: #000; color: #fff; padding: 10px;">
&lt;div id=&#8221;RB_loading&#8221;&gt;&lt;/div&gt;
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.codebelay.com/blog/2008/11/01/redboxing-with-rails-modal-windows-ftw/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Rails Console Makes Test Object Creation and Debugging Easy</title>
		<link>http://www.codebelay.com/blog/2008/08/21/the-rails-console-makes-test-object-creation-and-debuggingeasy/</link>
		<comments>http://www.codebelay.com/blog/2008/08/21/the-rails-console-makes-test-object-creation-and-debuggingeasy/#comments</comments>
		<pubDate>Thu, 21 Aug 2008 16:54:31 +0000</pubDate>
		<dc:creator>barce</dc:creator>
				<category><![CDATA[How-To]]></category>
		<category><![CDATA[ruby on rails]]></category>
		<category><![CDATA[WebApps]]></category>
		<category><![CDATA[debugging]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[rails console]]></category>

		<guid isPermaLink="false">http://www.codebelay.com/blog/?p=144</guid>
		<description><![CDATA[I really like how the Rails console solves the problems of test object creation and debugging. Usually, a web developer will push code to the webserver and hit shift-reload on the web browser. With the Rails console, you can avoid all that shift-reload madness. If I wanted to create 10000 blog posts for testing, I [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>I really like how the Rails console solves the problems of test object creation and debugging.</p>
<p>Usually, a web developer will push code to the webserver and hit shift-reload on the web browser. With the Rails console, you can avoid all that shift-reload madness.</p>
<p>If I wanted to create 10000 blog posts for testing, I could do something like this:</p>
<p><strong>script/console<br />
10000.times<br />
{ |i| Post.create(:title => &#8220;post number: &#8221; + i.to_s, :body => &#8220;autogen Booyah!&#8221;) }<br />
</strong><br />
Through the console I can also do debugging pretty easily:</p>
<p><strong>>> p = Post.find 888</strong></p>
<p>And get this as output:</p>
<pre>
=> #<Post id: 888, title: "post number: 888", body: "autogen Booyah!", created_at:
"2008-08-09 20:31:57", updated_at: "2008-08-09 20:31:57"></pre>
<p>A lot of problems in Rails are just solved by running script/console and checking the values of certain variables that are pretty hard to get at through a web browser.</p>
<p>There is pretty much no limit to what can be done through the Rails console. <a href="http://tektastic.com/">Konstantin Gredeskoul</a>, web developer and songwriter, has found a way to <a href="http://tektastic.com/2006/12/ruby-on-rails-how-to-load-session.html">load session data through the console</a>.</p>
<div class="js-kit-rating" title="Rated item" permalink=""></div>
<div class="js-kit-rating" title="Scored item" view="score" permalink=""></div>
<p><script src="http://js-kit.com/ratings.js"></script></p>
]]></content:encoded>
			<wfw:commentRss>http://www.codebelay.com/blog/2008/08/21/the-rails-console-makes-test-object-creation-and-debuggingeasy/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mephisto: Blogging Software on Rails</title>
		<link>http://www.codebelay.com/blog/2008/08/19/mephisto-blogging-software-on-rails/</link>
		<comments>http://www.codebelay.com/blog/2008/08/19/mephisto-blogging-software-on-rails/#comments</comments>
		<pubDate>Tue, 19 Aug 2008 18:25:34 +0000</pubDate>
		<dc:creator>barce</dc:creator>
				<category><![CDATA[ruby on rails]]></category>
		<category><![CDATA[TechBiz]]></category>
		<category><![CDATA[WebApps]]></category>
		<category><![CDATA[blogging]]></category>
		<category><![CDATA[blogging software]]></category>
		<category><![CDATA[mephisto]]></category>
		<category><![CDATA[rails]]></category>

		<guid isPermaLink="false">http://www.codebelay.com/blog/?p=125</guid>
		<description><![CDATA[Blogging software should meet four important criteria: 1) Easy import from a pre-existing piece of blogging software we&#8217;re not happy with. 2) Spam filtering protection in comments 3) Make it easy to add web analytics javascript tracking without deleting it during each upgrade. 4) Should make it easy to not look like Mephisto blogging software [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>Blogging software should meet four important criteria:<br />
1) Easy import from a pre-existing piece of blogging software we&#8217;re not happy with.<br />
2) <a href="http://akismet.com/">Spam filtering protection</a> in comments<br />
3) Make it easy to add web analytics javascript tracking without deleting it during each upgrade.<br />
4) Should make it easy to not look like Mephisto blogging software or WordPress or like generic blogging software.</p>
<p><a href="http://www.mephistoblog.com"><img src="http://www.codebelay.com/img/mephisto-overview.gif" alt="Mephisto screenshot" /></a></p>
<p><a href="http://www.mephistoblog.com/">Mephisto</a> meets all four criteria.</p>
<p>Plus it leverages the advantages of <a href="http://rubyonrails.org/">Rails</a> in that out of the box you can deploy to development, test and production environments. Also it integrates with no mess into shopify or any other Rails project that you might be working.</p>
<p>Hats off to  <a href="http://weblog.techno-weenie.net">Rick Olson</a><em>(Development)</em> and <a href="http://encytemedia.com">Justin Palmer</a><em>(UI/Design)</em> for making Mephisto along with &#8220;a bunch of other cool people.&#8221;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.codebelay.com/blog/2008/08/19/mephisto-blogging-software-on-rails/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.386 seconds -->

