<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-7033945969374781589</id><updated>2011-11-27T17:34:28.167-08:00</updated><category term='engines'/><category term='templates'/><category term='controllers'/><category term='theory'/><category term='active_affiliate'/><category term='new blog'/><category term='postgresql'/><category term='admin'/><category term='webrat'/><category term='visionaries'/><category term='cucumber'/><category term='theme_support'/><category term='Apple'/><category term='gems'/><category term='pylons'/><category term='iphone'/><category term='Weekend Challenge'/><category term='passenger'/><category term='pebkac'/><category term='tutorials'/><category term='git'/><category term='tips'/><category term='rails'/><category term='errors'/><category term='app management'/><category term='active merchant'/><category term='server'/><category term='30days_of_rails'/><category term='Merchant Accounts'/><category term='acts as ferret'/><category term='testing'/><category term='plugins'/><category term='capistrano'/><category term='tether'/><category term='update'/><category term='generator'/><category term='deploy'/><title type='text'>nerbie69 off rails</title><subtitle type='html'>Chronicling my experiences with ruby on rails, web application development/management.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://nerbie69.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7033945969374781589/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://nerbie69.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>nerbie69</name><uri>http://www.blogger.com/profile/00829233647136943532</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>38</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-7033945969374781589.post-8010773325439555557</id><published>2009-08-31T18:59:00.000-07:00</published><updated>2009-08-31T19:01:14.042-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='new blog'/><title type='text'>Blog Activity - switching blogs</title><content type='html'>&lt;p&gt;My use of this blog is slowing down. i will emerge at &lt;a href="http://www.ingraminternet.com"&gt;my new blog&lt;/a&gt;.  In this new blog you'll get all the same rails talk, just without the google/blogger chessiness.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7033945969374781589-8010773325439555557?l=nerbie69.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nerbie69.blogspot.com/feeds/8010773325439555557/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nerbie69.blogspot.com/2009/08/blog-activity-switching-blogs.html#comment-form' title='42 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7033945969374781589/posts/default/8010773325439555557'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7033945969374781589/posts/default/8010773325439555557'/><link rel='alternate' type='text/html' href='http://nerbie69.blogspot.com/2009/08/blog-activity-switching-blogs.html' title='Blog Activity - switching blogs'/><author><name>nerbie69</name><uri>http://www.blogger.com/profile/00829233647136943532</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>42</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7033945969374781589.post-7294209619804166288</id><published>2009-08-31T18:53:00.000-07:00</published><updated>2009-08-31T18:58:44.570-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='git'/><category scheme='http://www.blogger.com/atom/ns#' term='app management'/><title type='text'>Pre App launch jitters...</title><content type='html'>&lt;p&gt;I'm going into alpha/beta testing phase of my app.  I'm pretty excited but also am kinda nervous.&lt;/p&gt;&lt;p&gt;Whenever you launch a product of any kind, it's human nature to second guess yourself and to ask  "why am i doing this?" or "Will this work?".  Or the big one, am i ready&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Well you are never ready, it'll never be good enough, and you missed something. Big.  Shit happens. Be a man and move on.&lt;/p&gt;&lt;br /&gt;&lt;h2&gt;When you mess up your git pull&lt;/h2&gt;&lt;br /&gt;&lt;p&gt;Remember this chunk of code:&lt;br /&gt;&lt;code&gt;sudo git reset --hard HEAD&lt;/code&gt;&lt;/p&gt;&lt;p&gt;Use that code snippet when you don't care about the changes on the local machine you are git pulling and your git pull request won't merge.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7033945969374781589-7294209619804166288?l=nerbie69.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nerbie69.blogspot.com/feeds/7294209619804166288/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nerbie69.blogspot.com/2009/08/pre-app-launch-jitters.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7033945969374781589/posts/default/7294209619804166288'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7033945969374781589/posts/default/7294209619804166288'/><link rel='alternate' type='text/html' href='http://nerbie69.blogspot.com/2009/08/pre-app-launch-jitters.html' title='Pre App launch jitters...'/><author><name>nerbie69</name><uri>http://www.blogger.com/profile/00829233647136943532</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7033945969374781589.post-6948791058555504840</id><published>2009-07-10T20:42:00.001-07:00</published><updated>2009-08-02T07:55:13.537-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='gems'/><category scheme='http://www.blogger.com/atom/ns#' term='cucumber'/><category scheme='http://www.blogger.com/atom/ns#' term='testing'/><title type='text'>superclass mismatch for class ModelExampleGroup - Solved</title><content type='html'>&lt;p&gt;If you have been pulling your dick hair out, like i was, i thought i'd post this here, while i'm still in a rage.&lt;/p&gt;&lt;br /&gt;&lt;h2&gt;Error&lt;/h2&gt;&lt;br /&gt;&lt;p&gt;When you are running cucumber features, you get the following shit:&lt;br /&gt;&lt;code&gt;cucumber features&lt;br /&gt;superclass mismatch for class ModelExampleGroup (TypeError)...&lt;/code&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;At first, i commented out the remarkable line in environment.rb.  I have no idea what this gem does, And i don't want to know.  Hell, I only put it there because of a railscast i think, but this gem is fucking me up, so, again, i commented it out of the environment.rb file and everyone is happy.  Good riddance.&lt;/p&gt;&lt;br /&gt;&lt;h2&gt;FiX?&lt;/h2&gt;&lt;br /&gt;&lt;p&gt;I just installed remarkable-rails instead.  i guess the README in the github repo says how to do it. I've not gotten the error since.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7033945969374781589-6948791058555504840?l=nerbie69.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nerbie69.blogspot.com/feeds/6948791058555504840/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nerbie69.blogspot.com/2009/07/superclass-mismatch-for-class.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7033945969374781589/posts/default/6948791058555504840'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7033945969374781589/posts/default/6948791058555504840'/><link rel='alternate' type='text/html' href='http://nerbie69.blogspot.com/2009/07/superclass-mismatch-for-class.html' title='superclass mismatch for class ModelExampleGroup - Solved'/><author><name>nerbie69</name><uri>http://www.blogger.com/profile/00829233647136943532</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7033945969374781589.post-3472289676255576188</id><published>2009-07-01T14:01:00.000-07:00</published><updated>2009-07-20T06:21:51.918-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='tutorials'/><category scheme='http://www.blogger.com/atom/ns#' term='rails'/><category scheme='http://www.blogger.com/atom/ns#' term='30days_of_rails'/><title type='text'>30 days of Rails - Handling Flash Messages</title><content type='html'>&lt;p&gt;So, here i am trying to expand my closed world beyond Restful_authentication and well, basically any other technoweenie based plugin.  I try my hand at &lt;a href="http://github.com/thoughtbot/clearance/tree/master"&gt;Clearance&lt;/a&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Clearance is a thoughtbot based gem which authenticates users in your web app.  Out of the box, it only allows for email addresses as the login ID, which is fine for my stupid app i'm making.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;However, in all my years of scaffolding, i guess i've only really used flash[:notice] for displaying my flash messages on an overall layout level.  Clearance has flash[:success] and flash[:error]. &lt;/p&gt;&lt;br /&gt;&lt;p&gt;The reason i found this out is because my clearance_features weren't working and i was getting 8 failures, due to the fact that I was only displaying flash[:notice].  A win for BDD i tell ya.&lt;/p&gt;&lt;br /&gt;&lt;h2&gt;Gee mister, how'd you fix it&lt;/h2&gt;&lt;br /&gt;&lt;p&gt;Like all expert coders, i went to the one place I can trust.  Twitter.  I sent out a tweet which read: &lt;q&gt;&lt;i&gt;twitter ruby fun: lame, hack or on track? &lt; % = flash[:notice] ||flash[:success] || flash[:failure] % &gt;&lt;/i&gt;&lt;/q&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Most people hated this code, which is fine, as that is what i wanted to hear.  While it will work, if i had a need for two flash messages at once, or if i needed to expand my flash message symbols, i'd be fucked.  Enter &lt;a href="http://heycarsten.com/"&gt;@heycarsten&lt;/a&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;This dude turned me onto a pretty sweet &lt;a href="http://gist.github.com/138958"&gt;gist&lt;/a&gt; he wrote up for me. A thousand thank you sir's to him.&lt;/p&gt;&lt;br /&gt;&lt;h2&gt;Gist... Break it down hammer style.&lt;/h2&gt;&lt;br /&gt;&lt;p&gt;Well everytime you see me, the hammer is on dootie...ok, hammer time is over.&lt;/p&gt;&lt;br /&gt;&lt;object width="425" height="344"&gt;&lt;param name="movie" value="http://www.youtube.com/v/c_HM5doCc9A&amp;hl=en&amp;fs=1&amp;"&gt;&lt;/param&gt;&lt;param name="allowFullScreen" value="true"&gt;&lt;/param&gt;&lt;param name="allowscriptaccess" value="always"&gt;&lt;/param&gt;&lt;embed src="http://www.youtube.com/v/c_HM5doCc9A&amp;hl=en&amp;fs=1&amp;" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Create a helper called flash_helper.rb and paste this &lt;a href="http://gist.github.com/138958"&gt;gist&lt;/a&gt; into it.&lt;/li&gt;&lt;li&gt;inside the layouts directory, create a folder called partials and a partial inside of your layouts folder called /layouts/partials/flash_message.html.erb.&lt;/li&gt;&lt;li&gt;Paste this into it(stupid stupid blogger's formatting sucks ass... so you'll have to take the spaces out)&lt;br /&gt;&lt;pre&gt;&lt;code&gt;&lt; p id=&lt; % = "flash_#{type}" % &gt; &gt;&lt;br /&gt; &lt; % = flash[type.to_sym] % &gt;&lt;br /&gt;&lt; /p &gt;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;In your application_controller.html.erb you'll need to add this code to display your new fancy flash messages: &lt;br&gt;&lt;code&gt;&lt; % = flash_messages % &gt;&lt;/code&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;In your css file, now you can create styles with the id flash_whatever.  I used #flash_error{background-color: red;}, etc...If you are new to css, learn up on it son.&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;&lt;p&gt;Yeah for heycarsten and many thanks to him for allowing me to post this code.P.s., i apologize for this shitty code formatting.  blogspot sucks ass.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7033945969374781589-3472289676255576188?l=nerbie69.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nerbie69.blogspot.com/feeds/3472289676255576188/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nerbie69.blogspot.com/2009/07/30-days-of-rails-handling-flash.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7033945969374781589/posts/default/3472289676255576188'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7033945969374781589/posts/default/3472289676255576188'/><link rel='alternate' type='text/html' href='http://nerbie69.blogspot.com/2009/07/30-days-of-rails-handling-flash.html' title='30 days of Rails - Handling Flash Messages'/><author><name>nerbie69</name><uri>http://www.blogger.com/profile/00829233647136943532</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7033945969374781589.post-8400120033475244614</id><published>2009-06-29T09:40:00.000-07:00</published><updated>2009-06-29T10:04:41.280-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='30days_of_rails'/><title type='text'>30 days of Rails  - Hpricot parsing</title><content type='html'>&lt;p&gt;Scenario - You need some information off of a website, but there are around 100 rows.  This information will also need to populate the name column of your model, so you need to clean up the data.  Bascially you need to parse information from a paragraph or one big string.  This is where &lt;a href="http://wiki.github.com/why/hpricot/hpricot-basics"&gt;hpricot&lt;/a&gt; and some ruby come in handy.&lt;/p&gt;&lt;br /&gt;&lt;h2&gt;html string parser - Rake task&lt;/h2&gt;&lt;br /&gt;&lt;p&gt;Here is the code i ended up using, and will try and explain  it at the end&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;code&gt;&lt;br /&gt;namespace :sponsor do&lt;br /&gt;  desc "seed data"&lt;br /&gt;  task :seed =&gt; :environment do&lt;br /&gt;    require "open-uri"&lt;br /&gt;    require "hpricot"&lt;br /&gt;    doc = open("http://www.nascar.com/guides/sponsors/") { |f| Hpricot(f) }&lt;br /&gt;    @snag = (doc/"#cnnContentArea").inner_html&lt;br /&gt;    @snag.gsub(/&lt;.*&gt;/,'').split(/\n\t+/).map {|t| t.strip }.reject {|t|t=='' }.each { |t| Sponsor.create!(:name =&gt; t) }&lt;br /&gt;  end&lt;br /&gt;end&lt;/code&gt;&lt;/p&gt;&lt;br /&gt;&lt;h2&gt;Code explained&lt;/h2&gt;&lt;br /&gt;&lt;p&gt;I needed to pull information from that actual url.  All of this information lived within the div tag id cnnContentArea.  inside the source of the html page, it was prepopulated with \n\t\t\t and the number of tabs varied.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Using hpricot, we open the url page and save it as an hpricot object (see the doc = line above.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Next, we take the saved page and pull out the content from the cnnContentArea div tag, and we save it as an instance variable @snag.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;The last chunk of code, does the following:&lt;br /&gt;&lt;ol&gt;&lt;br /&gt;&lt;li&gt;The @snag string basically replaces itself without any of the paragraph tags (that what gsub does). &lt;/li&gt;&lt;li&gt;Next, the string is split into mini strings based on a delimiter, and in this case anything that matches \n followed by any number of tabs (\t).  I was lucky to be able to do it this way.&lt;/li&gt;&lt;li&gt;We then iterate through each mini string(that's what map is doing) and we then strip all whitespace, before and after the words in the mini string.  (see the block t.strip&lt;/li&gt;&lt;li&gt;As an added measure, if the mini array is empty, then it is rejected (courtesy of map)&lt;/li&gt;&lt;li&gt;Lastly, we then take the clean mini string and add it to our model, which in this case is a simple Sponsor model under the name column in the DB.&lt;/ol&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;I have to thank emitilin from IRC as he spruced up my code, but i do take solace in the fact that i knew where to go and now i have an even greater understanding of ruby and rails.  I'm sure in the comments you can point me to a method that does this in one fail swoop, but when you are learning ruby, you are a winner when you get to apply the knowledge to a problem you need fixed.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7033945969374781589-8400120033475244614?l=nerbie69.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nerbie69.blogspot.com/feeds/8400120033475244614/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nerbie69.blogspot.com/2009/06/30-days-of-rails-hpricot-parsing.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7033945969374781589/posts/default/8400120033475244614'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7033945969374781589/posts/default/8400120033475244614'/><link rel='alternate' type='text/html' href='http://nerbie69.blogspot.com/2009/06/30-days-of-rails-hpricot-parsing.html' title='30 days of Rails  - Hpricot parsing'/><author><name>nerbie69</name><uri>http://www.blogger.com/profile/00829233647136943532</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7033945969374781589.post-3147025844961106006</id><published>2009-06-26T08:39:00.001-07:00</published><updated>2009-06-27T07:37:24.560-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='30days_of_rails'/><title type='text'>30 days of Rails  - Model Associations</title><content type='html'>&lt;p&gt;You've picked the perfect model names for you new app, but you are unsure when to use a has many :through association or should it be a has and belongs to many association?  Or should it be a simple many to many association.  Wait, what about has_one and what the hell is a polymorphic anyways?&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Well at this point in the game, you may understand what each of the &lt;a href="http://guides.rubyonrails.org/association_basics.html"&gt;Model Associations&lt;/a&gt; do, when you branch out from the basics, or don't use them for awhile,  you end up forgetting when and where to use them.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;In an effort to streamline the decision of when to use the various &lt;a href="http://guides.rubyonrails.org/association_basics.html"&gt;Model Associations&lt;/a&gt; available in your rails app, I've come up with a decision tree app called &lt;a href="http://decision.heroku.com/"&gt;Model Association Decider&lt;/a&gt;. This decision tree will help you decide when to use a model association in rails.  So use this app to determine which association you should use. &lt;a href="http://decision.heroku.com/"&gt;Model Association Decider&lt;/a&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7033945969374781589-3147025844961106006?l=nerbie69.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nerbie69.blogspot.com/feeds/3147025844961106006/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nerbie69.blogspot.com/2009/06/30-days-of-rails-model-associations.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7033945969374781589/posts/default/3147025844961106006'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7033945969374781589/posts/default/3147025844961106006'/><link rel='alternate' type='text/html' href='http://nerbie69.blogspot.com/2009/06/30-days-of-rails-model-associations.html' title='30 days of Rails  - Model Associations'/><author><name>nerbie69</name><uri>http://www.blogger.com/profile/00829233647136943532</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7033945969374781589.post-6711117816238551269</id><published>2009-06-24T11:32:00.000-07:00</published><updated>2009-06-24T11:41:14.646-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='30days_of_rails'/><title type='text'>30 days of Rails Series - Introduction</title><content type='html'>&lt;p&gt;Well here i am.  I've taken a good look at what i need out of my life, computeristically speaking, and have decided that I am going to sink even more effort into learning Ruby on Rails, the one true and just framework, praise be unto him.&lt;/p&gt;&lt;br /&gt;&lt;h2&gt;Thirty Days of Rails.. WTF?&lt;/h2&gt;&lt;br /&gt;&lt;p&gt;What I've decided to do is document, a post a day for a month, about what i've learned in my rails journey from today moving forward.&lt;/p&gt;&lt;p&gt;I will focus on rails methodologies, techniques, optimization strategies, and anything else that i end up learning.&lt;/p&gt;&lt;br /&gt;&lt;h2&gt;What the 30 days of Rails isn't...&lt;/h2&gt;&lt;br /&gt;&lt;p&gt;This isn't a beginners class.  I won't explain myself as indepth as I would, had I started from scratch.  I'm starting with a loose grasp of rails knowledge obtained from a year and a half of using the framework.  That means, i know how to do shit, but i want to learn MORE so that i can create apps trouble-free from here on out.  Since I've made it my journey, I will pass these tidbits on to you, the gentle reader.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;So let's see where this thing ends up.  I take it that I'll probably end up with a lot of posts regarding TDD/BDD testing as i know sweet fuck all about it,however, I will post what i do find out, hoping it helps someone down the road.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7033945969374781589-6711117816238551269?l=nerbie69.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nerbie69.blogspot.com/feeds/6711117816238551269/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nerbie69.blogspot.com/2009/06/30-days-of-rails-series-introduction.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7033945969374781589/posts/default/6711117816238551269'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7033945969374781589/posts/default/6711117816238551269'/><link rel='alternate' type='text/html' href='http://nerbie69.blogspot.com/2009/06/30-days-of-rails-series-introduction.html' title='30 days of Rails Series - Introduction'/><author><name>nerbie69</name><uri>http://www.blogger.com/profile/00829233647136943532</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7033945969374781589.post-3403442626512341709</id><published>2009-06-24T11:22:00.000-07:00</published><updated>2009-06-24T11:29:52.286-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='cucumber'/><title type='text'>Populating Select menus in Cucumber</title><content type='html'>&lt;p&gt;From the easy when you finally know what you are doing, column....&lt;/p&gt;&lt;br /&gt;&lt;h2&gt;How the hell do you setup a select menu in a feature?&lt;/h2&gt;&lt;br /&gt;&lt;p&gt;Well, it turns out it's easy.  Not obvious to me, as nothing is in this testing BDD world, however. Basically &lt;b&gt;For every select menu you want to use in a feature, you must create a Background scenario to populate that select menu before every feature is ran&lt;/b&gt;&lt;/p&gt;&lt;br /&gt;&lt;h2&gt;Here's the code&lt;/h2&gt;&lt;br /&gt;&lt;p&gt;&lt;code&gt;Feature: Manage Driver lineup as an admin&lt;br /&gt;  In order to manage all drivers&lt;br /&gt;  As an admin&lt;br /&gt;  I want to be able to create and edit a list of drivers.&lt;br /&gt;&lt;br /&gt;Background:&lt;br /&gt;  Given I create a series "Nascar"&lt;br /&gt;&lt;br /&gt;Scenario: Login as admin&lt;br /&gt;  Given I am logged in as an admin&lt;br /&gt;  When I go to the admin homepage&lt;br /&gt;  And I follow "New Driver"&lt;br /&gt;  When I fill in "Name" with "Darryl Waltrip"&lt;br /&gt;  And I select "Nascar" from "Series"&lt;br /&gt;  And I press "Create"&lt;br /&gt;  Then I should see "New Driver saved succesfully"&lt;/code&gt;&lt;/p&gt;&lt;p&gt;&lt;small&gt;Nascar and all other known shit in the code above is copyright of their respective entities.  I am just using it as an example, so chilax&lt;/small&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Now in the background step you can just create the list of series(as i have it) using factories as so...&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;code&gt;Given /^I create a series "([^\"]*)"$/ do |arg1|&lt;br /&gt;  Factory(:league, :name =&gt; arg1)&lt;br /&gt;end&lt;/code&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Enjoy. yes it was easy, just no one told me how to do it, so i thought i'd see if i could help another soul out.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7033945969374781589-3403442626512341709?l=nerbie69.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nerbie69.blogspot.com/feeds/3403442626512341709/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nerbie69.blogspot.com/2009/06/populating-select-menus-in-cucumber.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7033945969374781589/posts/default/3403442626512341709'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7033945969374781589/posts/default/3403442626512341709'/><link rel='alternate' type='text/html' href='http://nerbie69.blogspot.com/2009/06/populating-select-menus-in-cucumber.html' title='Populating Select menus in Cucumber'/><author><name>nerbie69</name><uri>http://www.blogger.com/profile/00829233647136943532</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7033945969374781589.post-2685499072875924933</id><published>2009-06-22T13:33:00.000-07:00</published><updated>2009-06-24T11:30:53.151-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='cucumber'/><title type='text'>Important Cucumber step that must not be missed!</title><content type='html'>&lt;p&gt;Ok, this may just be an aha moment for myself, but i always thought that when i looked at ryan's screencasts on Cucumber we're overly weird.  That's right, i said it. &lt;/p&gt;&lt;br /&gt;&lt;p&gt;Now, why were they weird?  Well, he started out his steps by including the following kind of Given statements:&lt;br&gt;&lt;code&gt;Given I have zero articles&lt;br /&gt;# or&lt;br /&gt;Given I have an article named "Cheese"&lt;/code&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Without this step at this time, there is no way to follow a article_path("blah") link at all.  In my simple mind's eye, i thought there would be.&lt;/p&gt;&lt;br /&gt;&lt;h2&gt;Lessoned Learned?&lt;/h2&gt;&lt;br /&gt;&lt;p&gt;Stop being a moron and setup your Given statement to either start with a record or two for the model you are trying to BDD against, or make sure NONE exist, to start with a clean slate.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7033945969374781589-2685499072875924933?l=nerbie69.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nerbie69.blogspot.com/feeds/2685499072875924933/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nerbie69.blogspot.com/2009/06/important-cucumber-step-that-must-not.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7033945969374781589/posts/default/2685499072875924933'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7033945969374781589/posts/default/2685499072875924933'/><link rel='alternate' type='text/html' href='http://nerbie69.blogspot.com/2009/06/important-cucumber-step-that-must-not.html' title='Important Cucumber step that must not be missed!'/><author><name>nerbie69</name><uri>http://www.blogger.com/profile/00829233647136943532</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7033945969374781589.post-2981232000209893186</id><published>2009-06-20T07:53:00.000-07:00</published><updated>2009-06-20T09:47:12.459-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='rails'/><category scheme='http://www.blogger.com/atom/ns#' term='pylons'/><title type='text'>Rails vs Pylons - initial thoughts</title><content type='html'>&lt;p&gt;I know, I know!  Comparing two frameworks is bound to be riddled with generalizations that don't help anyone and obvious features that are only "ah ha" moments to the writer of the post.  However, I'm going to give you an account of my initial thoughts of Pylons, as compared to ruby on rails, a framework that I've been using for a year and a half.&lt;/p&gt;&lt;br /&gt;&lt;object width="425" height="344"&gt;&lt;param name="movie" value="http://www.youtube.com/v/NqHWHswHqRY&amp;hl=en&amp;fs=1&amp;color1=0x006699&amp;color2=0x54abd6"&gt;&lt;/param&gt;&lt;param name="allowFullScreen" value="true"&gt;&lt;/param&gt;&lt;param name="allowscriptaccess" value="always"&gt;&lt;/param&gt;&lt;embed src="http://www.youtube.com/v/NqHWHswHqRY&amp;hl=en&amp;fs=1&amp;color1=0x006699&amp;color2=0x54abd6" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;br /&gt;&lt;h2&gt;Comparing Pylons to Ruby on Rails&lt;/h2&gt;&lt;br /&gt;&lt;p&gt;Initial thoughts are how very similar these two frameworks are. &lt;a href="http://pylonshq.com/"&gt;Pylons&lt;/a&gt; basically admits that it takes well founded queues from rails.  But who wouldn't?&lt;/p&gt;&lt;br /&gt;&lt;p&gt;If you were to design a framework today, and you think it through, any MVC framework will smell like rails, which has hundreds of contributors, all tweeking the code base.  When a populist approach takes hold, you end up with some "trueisms"&lt;/p&gt;&lt;br /&gt;&lt;p&gt;All Pylons has done, from my inspection so for, is taken those trueisms as a starting point for their framework, and now are building off that on their own direction.&lt;/p&gt;&lt;br /&gt;&lt;h2&gt;Common Features between Pylons and Rails&lt;/h2&gt;&lt;br /&gt;&lt;p&gt;Here is what I noticed, 24 hours into trying Pylons, as it compares to Rails:&lt;/p&gt;&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;&lt;li&gt;File structure is similar - Rails and Pylons both create a whole bunch of files to the project folder.  Pylons however has more files outside of the project's directory that are used to setup information about the egg file.  Think of an egg as a ruby gem, i guess. &lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_KuJG6jhK9ZQ/Sjz7DCSDdZI/AAAAAAAAAAM/VXiMsNpms0I/s1600-h/Picture+18.png"&gt;&lt;img style="float:none; margin:0 10px 10px 0;cursor:pointer; cursor:hand;width: 220px; height: 320px;" src="http://2.bp.blogspot.com/_KuJG6jhK9ZQ/Sjz7DCSDdZI/AAAAAAAAAAM/VXiMsNpms0I/s320/Picture+18.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5349426486980081042" /&gt;&lt;/a&gt;&lt;br /&gt; Again, notice that inside the QuickWiki root folder, you have a QuickWiki folder where all your code goes into.  This to me, looks like what we'd see in rails.  Also, notice the models, Views(Templates) and Controller is mingling with the public folders, etc...&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Routes - these seem similar, down to the map.connect.  however, i've yet to find out if they implement Restful routing.  They do seperate their controller commands by controller and RestfulController, so time will tell.  Again, it's just been 24 hours.  On first impression, Pylons routing actually can do a lot more, then what i've seen in rails.  If this feature exists in rails, i've not seen or read about it in a year and a half.  In Pylons, the first routes are the ones handled last, where as in rails, the bottom of the routes file gets executed last.  Here is the example from their tutorial: &lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_KuJG6jhK9ZQ/Sjz9IzFhcnI/AAAAAAAAAAU/3yxsY90yit0/s1600-h/Picture+19.png"&gt;&lt;img style="float:none; margin:0 10px 10px 0;cursor:pointer; cursor:hand;width: 320px; height: 270px;" src="http://3.bp.blogspot.com/_KuJG6jhK9ZQ/Sjz9IzFhcnI/AAAAAAAAAAU/3yxsY90yit0/s320/Picture+19.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5349428785003459186" /&gt;&lt;/a&gt;&lt;br /&gt;Notice again, that last line before the return.  If you entered a url "/whatever" and it doesn't exist, the last route will create the page for  you, based on it being the title.  That title variable is passed to the show page and saved in the DB. Perfect for wiki applications.  I don't think I've seen that in rails, to date.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Environments - Both Pylons and Rails have development, test and production environments.  In pylons it appears that the environment files are housed in the outer file system, see image above to get what i'm saying.  the inner file system appears to be where you'd put most of your code for the MVC part of things.  Now in part two of this post, i'm sure to have written about production deployment and the differences there.  if not, screw you Lulz.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Error Pages/ Debugging - Both have a cool stack error printout on your browser, when you fuck up.  However, Pylons is interactive and you click on these arrows to get to the right code from within your browser.  You can also send Pylons an email right from the error page, if you wanted.&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;&lt;br /&gt;&lt;h2&gt;Differences between Rails and Pylons - initial thoughts&lt;/h2&gt;&lt;br /&gt;&lt;p&gt;I know i added some variances above too, but here is a list of things that is really different between the two frameworks:&lt;/p&gt;&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;&lt;li&gt;You are making an Egg file, not a web app. - Ok, this is my spin on the whole thing, but technically you are making a python egg that will just happen to be served through the web.  In rails, we are creating a web application in ruby.  Not a ruby gem, not a ruby script, a full on independent web application whose sole purpose is to be viewed through an internet browser.&lt;br /&gt;  While i may be putting it too simply, it was something to get used to that when you are coding you are technically creating a python egg file that you can either, give to your friends to play around on their computer, or serve it through the web, or what have you.  Maybe this has to do with the fact that you are creating a WSGI application.  Read &lt;a href="http://pylonshq.com/docs/en/0.9.7/concepts/"&gt;Pylons concepts here&lt;/a&gt; for more details.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Pylons needs to be running in a Python virtual environment, in order to work.  What that means is you can't just call Pylons create -t MyProject willy nilly.  No big deal, just something to get used to.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Pylons uses something similar to ActiveRecord, but in the python world it's called SQLAlchemy.  From the pylons site: SQLAlchemy is a powerful Python SQL toolkit and Object Relational Mapper (ORM) that is widely used by the Python community.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;No Migration files - All migrations are setup in the __init__.py file of the models directory.  Personally, rails has it right, with it's easy to understand migration creation, in my opinion.  However, Pylons isn't hard, it's just, well, more.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Templating Engines - Instead of ERB, they use Mako, by default.  It's not that strange when learning mako, as some of the nomenclature is similar.&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;&lt;br /&gt;&lt;h2&gt;Conclusion&lt;/h2&gt;&lt;br /&gt;&lt;p&gt;Both have their pros and cons.  I don't mind Pylons, and I'm going to try and create a project in Pylons, something other then the wiki from their tutorial.  I'll be bloging my way through that project, and giving you the usual uncandidness you've been accustomed to.  If you want to expand your web framework knowledge past rails, Pylons is a good choice to start with, without the huge learning curve.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7033945969374781589-2981232000209893186?l=nerbie69.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nerbie69.blogspot.com/feeds/2981232000209893186/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nerbie69.blogspot.com/2009/06/rails-vs-pylons-initial-thoughts.html#comment-form' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7033945969374781589/posts/default/2981232000209893186'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7033945969374781589/posts/default/2981232000209893186'/><link rel='alternate' type='text/html' href='http://nerbie69.blogspot.com/2009/06/rails-vs-pylons-initial-thoughts.html' title='Rails vs Pylons - initial thoughts'/><author><name>nerbie69</name><uri>http://www.blogger.com/profile/00829233647136943532</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_KuJG6jhK9ZQ/Sjz7DCSDdZI/AAAAAAAAAAM/VXiMsNpms0I/s72-c/Picture+18.png' height='72' width='72'/><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7033945969374781589.post-1887499596569606921</id><published>2009-05-18T04:43:00.000-07:00</published><updated>2009-05-19T07:38:18.925-07:00</updated><title type='text'>Spam Off - Acts_as_Snook Tutorial</title><content type='html'>&lt;p&gt;You wrote an awesome blog post.  You've enabled comments for this awesome blog post, only to find that some crappy spam turnkey operation has hit your post with 1000 cialis ads, and the other wang pill advertisements. &lt;/p&gt;&lt;p&gt; Listen, Comment Spam sucks ass.  If you've ever searched for an answer to stopping it, your research points you to one of four ways to stop comment spam traditionally.  These are:&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;&lt;li&gt;No comment spam filters at all - Users are allowed to comment willy nilly.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Captchas - weird images that look as though your seeing through beer goggles, whose text usually has to be written into a text field to prove your comment is coming from a human.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Site Members can comment only - the site's membership, of which you are visiting, are only allowed to comment on stories.  I am using that method in my blog, atm.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Moderated comments - your honest feedback about a post can only be posted, if a nameless/faceless drone 'approves' your comment worthy of being posted.  Doesn't say much for transparency.&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;While all of these above methods work to keep spam to a minimum, (and really that's all you can hope for i.e., minimal spam), there are glaring flaws in each and everyone one of the above methods.  Whether it's accessibility, too cumbersome to keep up with, or too communist, most of these methods have some kind of tradeoff.&lt;/p&gt;&lt;br /&gt;&lt;h2&gt;Enter Acts_as_snook&lt;/h2&gt;&lt;br /&gt;&lt;p&gt;From the README:&lt;bq&gt;ActsAsSnook is a simple and elegant method of handling comment spam that doesn’t rely on CAPTCHAS or Javascript or external web services. It uses a point based system to detect common traits of comment spam.&lt;/bq&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;The &lt;a href="http://github.com/rsl/acts_as_snook/tree/master"&gt;acts_as_snook&lt;/a&gt; plugin is a great way to keep spam at a minimum.  Rather then asking the user to do anything, acts_as_snook "scores" each comment based on a scoring system by &lt;a href="http://snook.ca/archives/other/effective_blog_comment_spam_blocker"&gt;Jonathon Snook&lt;/a&gt;. Once the comment has been saved into the database, the comment receives one of three possible spam statuses:&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;&lt;li&gt;Spam - the comment didn't pass the scoring system and will have a status of spam, set in the database.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Ham - the comment passes the scoring system and it's status is set to ham in the db.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Moderate - the comment is too close to call spam or ham, so it's status is set to moderate and is awaiting moderation.&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt; &lt;/p&gt;&lt;br /&gt;&lt;h2&gt;About the Plugin&lt;/h2&gt;&lt;br /&gt;&lt;p&gt;If anyone trolls in #rubyonrails, the IRC chatroom, you'll know the author of the &lt;a href="http://github.com/rsl/acts_as_snook/tree/master"&gt;acts_as_snook&lt;/a&gt; plugin, &lt;a href="http://luckysneaks.com/blog"&gt;rsl&lt;/a&gt;.  &lt;/p&gt;&lt;br /&gt;&lt;p&gt;He is also responsible for getting this song in my head, at the time of writing.  Bastard. &lt;object width="425" height="344"&gt;&lt;param name="movie" value="http://www.youtube.com/v/Kw54-rCIrPs&amp;hl=en&amp;fs=1"&gt;&lt;/param&gt;&lt;param name="allowFullScreen" value="true"&gt;&lt;/param&gt;&lt;param name="allowscriptaccess" value="always"&gt;&lt;/param&gt;&lt;embed src="http://www.youtube.com/v/Kw54-rCIrPs&amp;hl=en&amp;fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;/p&gt;&lt;br /&gt;&lt;h2&gt;Tutorial - How to use the Plugin&lt;/h2&gt;&lt;br /&gt;&lt;p&gt;&lt;b&gt;Don't cut and paste!!!  this stupid blogger crap is garbage!&lt;/b&gt; So if you want to cut and paste, you'll need to delete the spaces after and before each &lt; or  &gt; bracket.&lt;br /&gt;&lt;p&gt;&lt;b&gt;Assumptions&lt;/b&gt; - you know how to create a typical blog application that will use embedded comments at the end of each post. I'm assuming that you will have two models &lt;i&gt;Post&lt;/i&gt; and&lt;i&gt;Comment&lt;/i&gt;.  Before you begin, get a working Post model ready, as this tutorial is only about adding a Comment model that uses acts_as_snook.  Lastly, you'll want to make it prettier once your done these steps, so that is up to you do after, post modem.&lt;/p&gt;&lt;br /&gt;&lt;ol&gt;&lt;br /&gt; &lt;li&gt;&lt;h2&gt;You have a working Post model, right???&lt;/h2&gt;&lt;p&gt;Get your Post model working how you want it to work.  The inner workings aren't important for this tutorial.&lt;/p&gt;&lt;/li&gt;&lt;br /&gt; &lt;li&gt;&lt;h2&gt;Generate a Comments Model and a Post Migration&lt;/h2&gt;&lt;p&gt;We'll use the default settings in acts_as_snook, so that means we need our database to house these Comments table columns as outlined below.&lt;/p&gt;&lt;p&gt;&lt;code&gt;script/generate rspec_scaffold Comment author:string email:string url:string body:text spam_status:string post_id:integer&lt;/code&gt;&lt;/p&gt;&lt;br /&gt;  &lt;p&gt;Since we want to display how many GOOD comments we have (i.e, the ham), acts_as_snook will run a counter cache for each Post's ham comments.  All you have to create the following migration file and add the migration column information to it:&lt;br /&gt;&lt;br /&gt;   &lt;code&gt;script/generate migration AddHamCountToPost&lt;/code&gt;&lt;/p&gt;&lt;br /&gt;   &lt;p&gt;In your new migration file add the following:&lt;br /&gt;&lt;br /&gt;    &lt;code&gt;class AddHamCountToPost &lt; ActiveRecord::Migration&lt;br /&gt;      def self.up&lt;br /&gt;        add_column :posts, :ham_comments_count, :integer, :default =&gt; 0&lt;br /&gt;      end&lt;br /&gt;&lt;br /&gt;      def self.down&lt;br /&gt;        remove_column :posts, :ham_comments_count&lt;br /&gt;      end&lt;br /&gt;    end&lt;/code&gt;&lt;/p&gt;&lt;br /&gt;  &lt;/li&gt;&lt;br /&gt; &lt;li&gt;&lt;p&gt;Run Migration with &lt;br /&gt;&lt;code&gt;rake db:migrate&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;&lt;br /&gt; &lt;li&gt;&lt;h2&gt;Add Acts_as_Snook functionality&lt;/h2&gt;&lt;br /&gt;  &lt;p&gt;First make sure Post has_many Comments and Comments belongs_to Post.&lt;/p&gt;&lt;p&gt;Next add this to your Comment.rb file&lt;br /&gt; &lt;code&gt;acts_as_snook&lt;/code&gt;&lt;br /&gt;Damn, that was easy.&lt;/p&gt;&lt;br /&gt;  &lt;/li&gt;&lt;br /&gt;  &lt;li&gt;&lt;h2&gt;Fix the Comment views&lt;/h2&gt;&lt;br /&gt;   &lt;p&gt;Right now, your views are set to show all comments, that is not good.  Let's make your views shine!  So in your Post#show view, here is what i've done (since i show my comments at the end of each blog post, my @comments= @post.comments.  If you don't understand that, read up on associations in the rails guide).  I'll explain the code further afterwards.&lt;/p&gt;&lt;br /&gt;   &lt;p&gt;&lt;pre&gt;&lt; h1 &gt;Comments&lt; / h1 &gt;&lt;br /&gt;   &lt; % unless @comments.blank? %&gt;&lt;br /&gt;    &lt; % @comments.ham.each do |comment| %&gt;&lt;br /&gt;     &lt; p &gt;&lt;br /&gt;      &lt; % if comment.url.blank? %&gt;&lt;br /&gt;     &lt; %= comment.author %&gt; &lt;br /&gt;      &lt; % else %&gt;&lt;br /&gt;      &lt; %= link_to comment.author, comment.url %&gt;&lt;br /&gt;      &lt; % end %&gt;&lt;br /&gt;     says:&lt; br/ &gt;&lt;br /&gt;     &lt; %= comment.body %&gt;&lt; /p&gt;&lt;br /&gt;    &lt; % end %&gt;&lt;br /&gt;   &lt; % else %&gt;&lt;br /&gt;    &lt; p&gt;Be the first person to comment!&lt; /p&gt;&lt;br /&gt;   &lt; % end %&gt;&lt;/pre&gt;&lt;/p&gt;&lt;br /&gt;   &lt;p&gt;Simply put, we only want to show the ham(the good comments) and not the spam(shitty comments).  So we iterate through each ham comment, using the acts_as_snook supplied method &lt;i&gt;ham&lt;/i&gt;.&lt;/p&gt;  &lt;p&gt;The rest of this code, just shows the comment in a certain way that i wanted it to appear, your mileage will vary.&lt;/p&gt;&lt;/li&gt;&lt;br /&gt;   &lt;li&gt;&lt;h2&gt;Showing a Comment Count&lt;/h2&gt;&lt;br /&gt;    &lt;p&gt;One last little touch, is showing your readers how many comments each post has.  I put this information on the Post#index page, usually.  Here's one way you can implement a count for all ham comments.&lt;br /&gt;&lt;code&gt;&lt; % @posts.each do |post| % &gt;&lt;br /&gt;        &lt; h2 &gt;&lt; %= link_to post.title, post % &gt; ::~ &lt; %= pluralize post.ham_comments_count, "Comment" % &gt;&lt; /h2 &gt;&lt;br /&gt;        &lt; p &gt;&lt; %= truncate post.body, 25 % &gt;&lt; /p &gt;&lt;br /&gt;    &lt; % end % &gt;&lt;/code&gt;&lt;/p&gt;&lt;p&gt;Notice again, we iterate through the posts and for each post, we add their ham_comments_count.&lt;/p&gt;&lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&lt;br /&gt;&lt;h2&gt;Conclusion&lt;/h2&gt;&lt;br /&gt;&lt;p&gt;Acts_as_snook gives us a lot of easy to use methods, which i'll write more about in Acts_as_Snook part 2, which will include a moderation area for administrators.  Hopefully Acts_as_snook will take care of your comment spam nightmares, while giving you more time to sing, same as it ever was.  Letting the days go by....&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7033945969374781589-1887499596569606921?l=nerbie69.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nerbie69.blogspot.com/feeds/1887499596569606921/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nerbie69.blogspot.com/2009/05/spam-off-actsassnook-tutorial.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7033945969374781589/posts/default/1887499596569606921'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7033945969374781589/posts/default/1887499596569606921'/><link rel='alternate' type='text/html' href='http://nerbie69.blogspot.com/2009/05/spam-off-actsassnook-tutorial.html' title='Spam Off - Acts_as_Snook Tutorial'/><author><name>nerbie69</name><uri>http://www.blogger.com/profile/00829233647136943532</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7033945969374781589.post-2643671846589576649</id><published>2009-05-05T11:57:00.000-07:00</published><updated>2009-05-18T06:12:27.034-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='plugins'/><category scheme='http://www.blogger.com/atom/ns#' term='theme_support'/><title type='text'>Upcoming update to Theme support plugin</title><content type='html'>&lt;p&gt;I'm updating the theme support plugin to work with 2.3.2 now.  jystewart has done a tonne of work with it, but his plugin doesn't yet use the helpers, which my version does.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;We'll either combine forks or go our separate ways depending on how things play out, so stay tuned!!!&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Here is the &lt;a href="http://github.com/nerbie69/theme_support/tree/master"&gt;theme support&lt;/a&gt; repo on github.  Follow the fork link to jystewart's if interested.&lt;/p&gt;&lt;br /&gt;&lt;h2&gt;UPDATE - Use jystewart's github theme support for 2.3.2 and mine for 2.2.2 rails app&lt;/h2&gt;&lt;p&gt;For some stupid reason the core guys flip flopped on a code insertion that screwed up 2.2.2 and I had to fix it so that the helpers worked in rails 2.2.2.  &lt;/p&gt;&lt;p&gt;However, now that they reverted to code from 2.1.2 in 2.3.2, the old helper methods, which the jystewart version didn't touch, work fine.  So rather then mess with it, it's easier just to use jystwart's version.&lt;/p&gt;&lt;p&gt;Lastly, in rails 3.0 i think it will revert again, so stay tuned.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7033945969374781589-2643671846589576649?l=nerbie69.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nerbie69.blogspot.com/feeds/2643671846589576649/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nerbie69.blogspot.com/2009/05/upcoming-update-to-theme-support-plugin.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7033945969374781589/posts/default/2643671846589576649'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7033945969374781589/posts/default/2643671846589576649'/><link rel='alternate' type='text/html' href='http://nerbie69.blogspot.com/2009/05/upcoming-update-to-theme-support-plugin.html' title='Upcoming update to Theme support plugin'/><author><name>nerbie69</name><uri>http://www.blogger.com/profile/00829233647136943532</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7033945969374781589.post-5382559480696559115</id><published>2009-05-01T20:11:00.000-07:00</published><updated>2009-05-02T04:40:52.756-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='rails'/><category scheme='http://www.blogger.com/atom/ns#' term='testing'/><title type='text'>When in doubt... Factory it out...</title><content type='html'>&lt;p&gt;Boy did i have a doozy of a day trying to get some basic tests to pass, after i added some validations to a basic rspec_scaffold.  Using the barebones tests, adding the validates_presence_of and a validates_uniqueness_of both borked the test... which was fine, i expected that.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;What i didn't expect was that when i commented out both validations, my create test spec method would still work.  in essence, it didn't.  It could have been something i did, whatever. I fixed the failing tests by simply switching to Factories, instead of fixtures, or whatever the base rspec scaffold would use in a model test.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;If you are getting some weird errors, simply try to use factories instead.  Try out &lt;a href="http://thoughtbot.com/projects/factory_girl"&gt;Factory Girl by Thoughtbot&lt;/a&gt; for an example of one that I can say works.  haven't tried too hard to get &lt;a href="http://github.com/notahat/machinist/tree/master"&gt;machinist&lt;/a&gt; to work yet, but heard good things too.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7033945969374781589-5382559480696559115?l=nerbie69.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nerbie69.blogspot.com/feeds/5382559480696559115/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nerbie69.blogspot.com/2009/05/when-in-doubt-factory-it-out.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7033945969374781589/posts/default/5382559480696559115'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7033945969374781589/posts/default/5382559480696559115'/><link rel='alternate' type='text/html' href='http://nerbie69.blogspot.com/2009/05/when-in-doubt-factory-it-out.html' title='When in doubt... Factory it out...'/><author><name>nerbie69</name><uri>http://www.blogger.com/profile/00829233647136943532</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7033945969374781589.post-2278518744376541791</id><published>2009-04-25T19:42:00.000-07:00</published><updated>2009-07-10T09:50:25.070-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='rails'/><category scheme='http://www.blogger.com/atom/ns#' term='templates'/><title type='text'>Rails Template FTW</title><content type='html'>&lt;p&gt;Boy oh boy, rails templates kick ass.  I just made a template that has everything i need to start an user authenticated monthly subscription rspec app.&lt;/p&gt;&lt;br /&gt;&lt;h2&gt;What's this template got that i ain't got?&lt;/h2&gt;&lt;br /&gt;&lt;p&gt;Other then charisma and a good sense of style, it has &lt;ul&gt;&lt;br /&gt;&lt;li&gt;Restful_authentication w/ AASM &amp;&amp; will_paginate - creates your User and Session automatically&lt;/li&gt;&lt;li&gt;Active_Merchant - sets you up for adding monthly subscription code&lt;/li&gt;&lt;li&gt;Subdomain_fu - allows for easy account creation with subdomains.&lt;/li&gt;&lt;li&gt;Testing: Rspec, Cucumber, machinist, faker, factory_girl too&lt;/li&gt;&lt;li&gt;rspec scaffold an account model to begin your journey&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;&lt;br /&gt;&lt;p&gt;Rails templates are good to get you going but they are just a starting point, you still need to add certain bits of code to make stuff work, like &lt;br&gt;&lt;code&gt;require 'aasm' &lt;/code&gt;&lt;br /&gt;to your config/environment.rb file.&lt;/p&gt;&lt;br /&gt;&lt;h2&gt;How to Rock the Template&lt;/h2&gt;&lt;br /&gt;&lt;p&gt;Type the following into your console&lt;br /&gt;&lt;code&gt;rails -m http://github.com/nerbie69/rails-templates/restful_merchant_account.rb app_name_here -d postgresql&lt;/code&gt;&lt;br /&gt;Remember that the code above will create a postgres based rails app, so supply whatever DB flag you want, mysql, couchdb etc, and replace app_name_here with whatever you want to call you app.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7033945969374781589-2278518744376541791?l=nerbie69.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nerbie69.blogspot.com/feeds/2278518744376541791/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nerbie69.blogspot.com/2009/04/rails-template-ftw.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7033945969374781589/posts/default/2278518744376541791'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7033945969374781589/posts/default/2278518744376541791'/><link rel='alternate' type='text/html' href='http://nerbie69.blogspot.com/2009/04/rails-template-ftw.html' title='Rails Template FTW'/><author><name>nerbie69</name><uri>http://www.blogger.com/profile/00829233647136943532</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7033945969374781589.post-3281525392619895029</id><published>2009-04-15T07:30:00.000-07:00</published><updated>2009-04-15T11:23:51.557-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='rails'/><category scheme='http://www.blogger.com/atom/ns#' term='visionaries'/><title type='text'>Rails Visionaries  - Gems/Plugins Top Contributors</title><content type='html'>&lt;p&gt;The following is a list of the people/companies whom i feel are leading the pack when it comes to the most useful gems and/or plugins.  My criteria is that the gem/plugins are almost KEY to any rails app that needs them, and that this person/company has more then ONE key gem/plugin. FYI - I left out DHH, he gets enough accolades. Let's begin&lt;/p&gt;&lt;br /&gt;&lt;ol&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="http://techno-weenie.net/"&gt;Technoweenie&lt;/a&gt; &lt;em&gt;&lt;a href="http://github.com/technoweenie/"&gt;github repo&lt;/a&gt;&lt;/em&gt; - Where would a lot of rails apps be without restful_authentication and attachment_fu, just to start.  When you add in Acts_as_paranoid and his work with Mephisto, we owe this dude a big thanks for making components of what we do in rails easier and more efficient. &lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="http://thoughtbot.com/"&gt;thoughtbot&lt;/a&gt; &lt;em&gt;&lt;a href="http://github.com/thoughtbot/"&gt;github repo&lt;/a&gt;&lt;/em&gt; - This company keeps pumping out hit after plugin/gem hit.  In the field of testing, they help simplify our testing needs by putting out shoulda and factory girl.  In the authentication field, they gave us clearance and paperclip.  In the error notification field, they offer hoptoad, (which is rad). &lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="http://mbleigh.com/"&gt;mbleigh&lt;/a&gt; &lt;em&gt;&lt;a href="http://github.com/mbleigh/"&gt;github repo&lt;/a&gt;&lt;/em&gt; - Now mbleigh is a dude that should get mad props, and you should get to know his work, if you aren't familiar yet with him.  Essential gems/plugins such as subdomain_fu and twitter_auth are just two of his current 24 projects he has on his repo.  When you add acts_as_taggable_on and his ubercool uberkit (for easier form and menu creation), you realize how truly original his work is to our community.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="http://www.phusion.nl/products.html"&gt;Phusion&lt;/a&gt; &lt;em&gt;&lt;a href="http://github.com/FooBarWidget"&gt;github repo&lt;/a&gt;&lt;/em&gt; - Passenger makes all production app serving easier.  Back in the day, it was mongrel that made things easier... things keep evolving.  However, i can't see how it could get any easier beyond Passenger, which makes setting up your slice/VPS extremely easy. And from their website they describe the Ruby Enterprise Edition as &lt;quote&gt;Transparently improve scalability and efficiency of Ruby on Rails web applications.&lt;/quote&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="http://blog.shopify.com/"&gt;Shopify&lt;/a&gt; &lt;em&gt;&lt;a href="http://github.com/Shopify/"&gt;github repo&lt;/a&gt;&lt;/em&gt; - If you handle anything to do with ecommerce you must bow at the generosity of the shopify folks.  You have active_merchant, active_fulfillment and active_shipping. easy enough to use, powerful and well thoughtout and maintained.&lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&lt;br /&gt;&lt;h2&gt;Honourable Mention&lt;/h2&gt;&lt;br /&gt;&lt;p&gt;There is no question to the visionary impact that these individuals have made to the rails community and furthering it's progress.  In the spirit of this post however, these luminaries have given us fantastic testing apps, while this post was looking at those who have given us more then just one type of gem/plugin.&lt;/p&gt;&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="http://blog.aslakhellesoy.com/"&gt;aslakhellesoy&lt;/a&gt; &lt;em&gt;&lt;a href="http://github.com/aslakhellesoy"&gt;github repo&lt;/a&gt;&lt;/em&gt; - Cucumber is making BDD testing easier for everyone.  A killer gem that makes learning testing palatable.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="http://blog.davidchelimsky.net/"&gt;dchelimsky&lt;/a&gt; &lt;em&gt;&lt;a href="http://github.com/dchelimsky"&gt;github repo&lt;/a&gt;&lt;/em&gt; - RSpec. enough said. &lt;em&gt;(I do realize it is a team of core dev's who create this, but for clarity purposes, his name is usually at the forfront of any rspec conversation).&lt;/em&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="http://ts.freelancing-gods.com/"&gt;thinking_sphinx&lt;/a&gt; &lt;em&gt;&lt;a href="http://github.com/freelancing-god/thinking-sphinx/tree/master"&gt;github&lt;/a&gt;&lt;/em&gt; and &lt;a href="http://rm.jkraemer.net/projects/show/aaf"&gt;acts_as_ferret&lt;/a&gt; &lt;em&gt;&lt;a href="http://github.com/jkraemer/acts_as_ferret/tree/master"&gt;github&lt;/a&gt;&lt;/em&gt; - Good search plugins and gems.  You are either a Ferret guy or a Sphinx guy.&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;&lt;br /&gt;&lt;p&gt;Well that is the list. Enjoy&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7033945969374781589-3281525392619895029?l=nerbie69.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nerbie69.blogspot.com/feeds/3281525392619895029/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nerbie69.blogspot.com/2009/04/rails-visionaries-gemsplugins-top.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7033945969374781589/posts/default/3281525392619895029'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7033945969374781589/posts/default/3281525392619895029'/><link rel='alternate' type='text/html' href='http://nerbie69.blogspot.com/2009/04/rails-visionaries-gemsplugins-top.html' title='Rails Visionaries  - Gems/Plugins Top Contributors'/><author><name>nerbie69</name><uri>http://www.blogger.com/profile/00829233647136943532</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7033945969374781589.post-1481591403292139271</id><published>2009-04-14T07:03:00.000-07:00</published><updated>2009-04-14T08:06:19.836-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='webrat'/><category scheme='http://www.blogger.com/atom/ns#' term='testing'/><title type='text'>Struggles with webrat via cucumber</title><content type='html'>&lt;p&gt;&lt;em&gt;I know that this will end up being pebkac... but it still is annoying&lt;/em&gt;&lt;p&gt;&lt;br /&gt;&lt;p&gt;So i have a problem.  webrat is not acting how i thought it was supposed to.  Ryan Bate's railscast on cucumber made this shit look so easy.  And for the most part, it is.&lt;/p&gt;&lt;p&gt;However, when you go beyond what he had in his &lt;a href="http://railscasts.com/episodes/155-beginning-with-cucumber"&gt;railscast - beginning cucumber&lt;/a&gt;, webrat takes me off the rails very fast.&lt;/p&gt;&lt;br /&gt;&lt;h2&gt;to the Code...&lt;/h2&gt;&lt;br /&gt;&lt;p&gt;all i wanted to do was select my choice from a dropdown menu.  According to webrat/cucumber webrat_steps.rb file it should be&lt;br /&gt;&lt;code&gt;I select "option" from "field"&lt;/code&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;So in my scenario, i used the field name "tweet[style_id]" and the option "story".&lt;br /&gt;&lt;code&gt;I select "story" from "tweet[style-id]"&lt;/code&gt;  &lt;br /&gt; You may be wondering what that tweet[ ] business is all about, well that was the only way my scenario would go green, is if i used the label name in that style of code.  Since i am not using a symbol in my&lt;br /&gt;&lt;code&gt; f.label :body, "I want to show this text"&lt;/code&gt;  if you were simply using f.label :body,  you wouldn't need the tweet[ ] syntax.&lt;/p&gt;&lt;br /&gt;&lt;h2&gt;Updates&lt;/h2&gt;&lt;p&gt;i did find this ruby forum &lt;a href="http://www.ruby-forum.com/topic/170790"&gt;post&lt;/a&gt;, however he simply had the wrong description text. Since my text is one word, and i copied and pasted from the view source code, i don't think that is my problemo. Maybe i should try using the label field without the quotes?&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7033945969374781589-1481591403292139271?l=nerbie69.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nerbie69.blogspot.com/feeds/1481591403292139271/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nerbie69.blogspot.com/2009/04/struggles-with-webrat-via-cucumber.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7033945969374781589/posts/default/1481591403292139271'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7033945969374781589/posts/default/1481591403292139271'/><link rel='alternate' type='text/html' href='http://nerbie69.blogspot.com/2009/04/struggles-with-webrat-via-cucumber.html' title='Struggles with webrat via cucumber'/><author><name>nerbie69</name><uri>http://www.blogger.com/profile/00829233647136943532</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7033945969374781589.post-8847325547928440622</id><published>2009-04-03T18:15:00.000-07:00</published><updated>2009-04-03T19:56:48.328-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='rails'/><category scheme='http://www.blogger.com/atom/ns#' term='Weekend Challenge'/><title type='text'>Weekend Rails Challenge #1</title><content type='html'>&lt;p&gt;Thanks for participating in the first ever Weekend Rails Challenge.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;The rules are simple for this challenge:&lt;br /&gt; &lt;strong&gt;You have 48 hours to code a "For-Profit" based rails app using the twitter api.  Also your app must have a colour scheme revolving around the following hex code #7C6D8A&lt;/strong&gt;. Lastly you app Must be online and useable, hosted by yourself of course on your vps slice or node.&lt;br /&gt;The challenge will run for a month and a winner will be chosen based on the app which gains the best combined score based on five different criterion.&lt;br /&gt; &lt;/p&gt;&lt;br /&gt; &lt;h2&gt;Judging the winner&lt;/h2&gt;&lt;br /&gt; &lt;p&gt;&lt;br /&gt;  The winning app will have demonstrated the best TOTAL score of the following criteria:&lt;br /&gt;  &lt;ul&gt;&lt;br /&gt;   &lt;li&gt;&lt;strong&gt;(20%) Quality of Code &lt;/strong&gt; - Following the rails mantra of DRY and readability, a mark will be given to you based on how well your code follows these coding principles.  Usually you would test along the way but we've decided that in 48 hours that is not mandatory for this challenge. &lt;/li&gt;&lt;br /&gt;   &lt;li&gt;&lt;strong&gt;(20%) Site Popularity &lt;/strong&gt; - The site with the highest Alexa ranking at the end of the month will receive a full 20 points, 18 for the second best rank, down to 12 for the worst ranked site. &lt;strong&gt;5 bonus points are rewarded for a mention in twitters sidebar menu (located below the profile of a twitter user)&lt;/strong&gt;&lt;/li&gt;&lt;br /&gt;   &lt;li&gt;&lt;strong&gt;(10%) Site Look and (10%) User Interface/Interaction &lt;/strong&gt; - The site with the best looking and most functional user interface will gain top points in this category. Places 2nd, 3rd, and 4th will recieve 2 points less then the preceding ranking&lt;/li&gt;&lt;br /&gt;   &lt;li&gt;&lt;strong&gt;(20%) Revenue made in a month&lt;/strong&gt; - The site with the most revenue made during the month will gain top points in this category. Places 2nd, 3rd, and 4th will recieve 2 points less then the preceding ranking.&lt;/li&gt;&lt;br /&gt;   &lt;li&gt;&lt;strong&gt;(20%) Most Creative Use of the given rules&lt;/strong&gt; - An app that demonstrates the most creative and functional use of the given rules will gain top points in this category. Places 2nd, 3rd, and 4th will recieve 2 points less then the preceding ranking.&lt;/li&gt;&lt;br /&gt;   &lt;br /&gt;  &lt;/ul&gt;&lt;br /&gt; &lt;/p&gt;&lt;br /&gt; &lt;h2&gt;How will the scores be judged?&lt;/h2&gt;&lt;br /&gt; &lt;p&gt;No idea, but i know that we participants will vote and we'll ask someone or a few people from ROR to vote on things like coding, site look and feel and creativity. &lt;/p&gt;&lt;br /&gt;&lt;h2&gt;Submission Deadline:&lt;/h2&gt;&lt;br /&gt; &lt;p&gt;We'll report back who ends up in the final challenge eventually, but if you want to enter, you MUST post a comment below regarding &lt;strong&gt;the purpose or solution you came up with for your app&lt;/strong&gt; by 12 noon, as of you own time zone, on Saturday April 4th.  &lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;Good Luck Challengers&lt;/h2&gt;&lt;br /&gt; &lt;p&gt;Best of luck and hey who knows... you could get a great money making app out of it.  At worst, you made some new friendships and had a good weekend coding and learning.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7033945969374781589-8847325547928440622?l=nerbie69.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nerbie69.blogspot.com/feeds/8847325547928440622/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nerbie69.blogspot.com/2009/04/weekend-rails-challenge-1.html#comment-form' title='7 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7033945969374781589/posts/default/8847325547928440622'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7033945969374781589/posts/default/8847325547928440622'/><link rel='alternate' type='text/html' href='http://nerbie69.blogspot.com/2009/04/weekend-rails-challenge-1.html' title='Weekend Rails Challenge #1'/><author><name>nerbie69</name><uri>http://www.blogger.com/profile/00829233647136943532</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>7</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7033945969374781589.post-8603799194957434320</id><published>2009-03-14T06:47:00.000-07:00</published><updated>2009-03-14T07:08:36.847-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='plugins'/><category scheme='http://www.blogger.com/atom/ns#' term='rails'/><category scheme='http://www.blogger.com/atom/ns#' term='active_affiliate'/><title type='text'>Creating a Rails Plugin - thoughts behind Active_Affiliate</title><content type='html'>&lt;p&gt;I'm about to launch a new whizbang plugin.  Really excited about it as i think it will add something to the Rails community and show that i have learned SOMETHING over these last 18 months.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;I just wanted to document the thought process for this plugin, without talking about the code.  Hopefully you find it interesting, or even helpful&lt;/p&gt;&lt;br /&gt;&lt;h2&gt;Thought Process&lt;/h2&gt;&lt;br /&gt;&lt;p&gt;I started with the premise that if you run a successful web app, that charges a membership/account fee, you will need some way to bring in new customers.  Affiliate programs are a way to leverage the Internet Marketing initiative and your app.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;There really are just two main players in the affiliate space, &lt;a href="http://www.cj.com/"&gt;commission junction&lt;/a&gt; and &lt;a href="http://www.linkshare.com/"&gt;Linkshare&lt;/a&gt;.  There isn't anything wrong with these programs and chances are you'll need them too, but hosting your own affiliate program and managing it how you want, was a dream i wanted to fulfill.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Since i code in rails, and there was no solution, i created one.  Here are some of the features.&lt;br /&gt; &lt;ul&gt;&lt;br /&gt;  &lt;li&gt;Affiliate Signup through a route /affiliates&lt;/li&gt;&lt;br /&gt;  &lt;li&gt;Affiliates get their own unique code&lt;/li&gt;&lt;br /&gt;  &lt;li&gt;Primitive banner ad generator that will populate link with their code&lt;/li&gt;&lt;br /&gt;  &lt;li&gt;Affiliate code tracking put in session variables, and saved on customer purchase, through your checkout/signup sheet.&lt;/li&gt;&lt;br /&gt;  &lt;li&gt;Currently, paypal id's are needed so the user can get paid.&lt;/li&gt;&lt;br /&gt;  &lt;li&gt;Reporting for both the Affiliates and App Management.&lt;/li&gt;&lt;br /&gt; &lt;/ul&gt;&lt;/p&gt;&lt;br /&gt; &lt;p&gt;I'll be updating &lt;a href="http://github.com/nerbie69/active_affiliate/tree/master"&gt;active_affiliate on github&lt;/a&gt; as features are implemented.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7033945969374781589-8603799194957434320?l=nerbie69.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nerbie69.blogspot.com/feeds/8603799194957434320/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nerbie69.blogspot.com/2009/03/creating-rails-plugin-non-tutorial.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7033945969374781589/posts/default/8603799194957434320'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7033945969374781589/posts/default/8603799194957434320'/><link rel='alternate' type='text/html' href='http://nerbie69.blogspot.com/2009/03/creating-rails-plugin-non-tutorial.html' title='Creating a Rails Plugin - thoughts behind Active_Affiliate'/><author><name>nerbie69</name><uri>http://www.blogger.com/profile/00829233647136943532</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7033945969374781589.post-7737060488547872520</id><published>2009-03-12T08:24:00.000-07:00</published><updated>2009-03-12T10:09:17.126-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='rails'/><category scheme='http://www.blogger.com/atom/ns#' term='tips'/><title type='text'>Weird script/generate scaffold behaviour</title><content type='html'>&lt;p&gt;As always feel free to correct me if i'm wrong, but here is some wacky behaviour i got when i used the following code to generate scaffolding from rails 2.2.2 core (i.e., no plugins or scaffolding generator plugins at all)&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;code&gt;script/generate scaffold affiliate name:string user_id:integer&lt;/code&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;What was happening to my code was views not being found.  restful paths not being found, even when i triple checked my routes file.  To solve this i simply reran the code with a capital letter for the model name, as shown below.&lt;/p&gt;&lt;br /&gt;&lt;h2&gt;What should the code be??&lt;/h2&gt;&lt;br /&gt;&lt;p&gt;&lt;code&gt;script/generate scaffold Affiliate name:string user_id:integer&lt;/code&gt;&lt;/p&gt;&lt;br /&gt;&lt;h2&gt;Treat scaffold like every model is always CamelCase&lt;/h2&gt;&lt;br /&gt;&lt;p&gt;By that i mean no matter what the name of your model is going to be always Capitalize the main words for that model. So single word models like Ass, Border, User are good.  Never start with a lowercase ass, border or user.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;This is just a rule i follow, as i've yet to see it let me down.  It might just have been a momentary blip we all experience in our coding life, however capitalized models have never shown me that blip to date, so i'll run with it!&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7033945969374781589-7737060488547872520?l=nerbie69.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nerbie69.blogspot.com/feeds/7737060488547872520/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nerbie69.blogspot.com/2009/03/weird-scriptgenerate-scaffold-behaviour.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7033945969374781589/posts/default/7737060488547872520'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7033945969374781589/posts/default/7737060488547872520'/><link rel='alternate' type='text/html' href='http://nerbie69.blogspot.com/2009/03/weird-scriptgenerate-scaffold-behaviour.html' title='Weird script/generate scaffold behaviour'/><author><name>nerbie69</name><uri>http://www.blogger.com/profile/00829233647136943532</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7033945969374781589.post-5049305878369954675</id><published>2009-03-09T11:46:00.000-07:00</published><updated>2009-03-09T12:18:50.939-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='rails'/><category scheme='http://www.blogger.com/atom/ns#' term='testing'/><title type='text'>Rails Testing Confessions</title><content type='html'>&lt;p&gt;&lt;em&gt;Father, My name is pjammer and i have confession to make.  I've made 4 web apps and didn't test one of them, in a rails sense.&lt;/em&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;That's right.  Not one of my apps were tested using shoulda, coulda, woulda.  Rspec was just a figment of someone's imagination, when i launched my apps, cause it sure wasn't in my mind's eye.  Factory girl is a movie about some broad from the 60's and Object daddy just sounds creepy&lt;/p&gt;&lt;br /&gt;&lt;h2&gt;Let me repent for my testing sins!!!&lt;/h2&gt;&lt;br /&gt;&lt;p&gt;&lt;em&gt;Father, I'm here today to repent for the sins of not testing my apps.  I really want to learn&lt;/em&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Learning about testing is like searching google for a future thought.  Lots of ideas you can get out of it, but nothing that says "HERE IT IS MY SON".&lt;/p&gt;&lt;p&gt;This post won't help you either, but it should give others who want to make a lot of money, teaching other users how to write tests for rails, some kind of "IDEA" for a tell all book about testing.&lt;/p&gt;&lt;br /&gt;&lt;h2&gt;The Big Idea&lt;/h2&gt;&lt;br /&gt;&lt;p&gt;&lt;em&gt;Father, why hath thou forsaken my learning?  Learning Rails was easy... tonnes of help on blog posts, forums, etc... yet when it comes to LEARNING HOW TO TEST, doth hast left that chapter blank in thy bible&lt;/em&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Here is what i think someone could make a mint from writing a book that steps a user through building tests from TIT to TAIL.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;For instance: &lt;ul&gt;&lt;li&gt;What is testing and why it's important&lt;/li&gt;&lt;li&gt;There are four facets to testing&lt;ul&gt;&lt;li&gt;Functional Tests&lt;/li&gt;&lt;li&gt;Unit Tests&lt;/li&gt;&lt;li&gt;Integration Tests and&lt;/li&gt;&lt;li&gt;Fixtures&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;Take each testing facet above and step through each assertion and when to use each assertion and 5 or 6 real life examples for each.&lt;/li&gt;&lt;li&gt;Focus just on Test::Unit, Shoulda, and Machinist &amp; Faker for Functional and Unit Testing, as well as fixtures&lt;/li&gt;&lt;li&gt;Lastly, use some cool visual tool like webrat or Selenium&lt;/li&gt;&lt;/ul&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;em&gt;Father, thank you.  I will say my 10 hail mary's&lt;/em&gt;&lt;/p&gt;&lt;p&gt;In closing god would be happier with a book such as this, as less rails noobs and testing noobs would be praying for this kind of mundane nonesense. Leaving more time to fight the good fight.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7033945969374781589-5049305878369954675?l=nerbie69.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nerbie69.blogspot.com/feeds/5049305878369954675/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nerbie69.blogspot.com/2009/03/rails-testing-confessions.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7033945969374781589/posts/default/5049305878369954675'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7033945969374781589/posts/default/5049305878369954675'/><link rel='alternate' type='text/html' href='http://nerbie69.blogspot.com/2009/03/rails-testing-confessions.html' title='Rails Testing Confessions'/><author><name>nerbie69</name><uri>http://www.blogger.com/profile/00829233647136943532</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7033945969374781589.post-878986156890451621</id><published>2009-02-18T20:27:00.000-08:00</published><updated>2009-03-01T10:42:28.787-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='gems'/><category scheme='http://www.blogger.com/atom/ns#' term='postgresql'/><title type='text'>PostgreSQL on Mac OS X from source, with gem!</title><content type='html'>&lt;p&gt;This one was a bitch for me.  I started with the one click installer from the postgresql website, not worth the time.  maybe it worked, but sure as shit didn't appear to work for me.&lt;/p&gt;&lt;br /&gt;&lt;h2&gt;Steps i took to get PostgreSQL and postgres gem on my macbook (Intel)&lt;/h2&gt;&lt;br /&gt;&lt;p&gt; I'll source these links later, but basically I:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;downloaded the source code from Postgres's site.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Used the following commands&lt;br /&gt;&lt;code&gt;./configure \&lt;br /&gt;&gt; --with-includes=/usr/local/include \&lt;br /&gt;&gt; --with-libraries=/usr/local/lib&lt;br /&gt;make&lt;br /&gt;sudo make install&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;put it into my $PATH directory (so annoying when it's not there)&lt;br /&gt;&lt;code&gt;PATH=$PATH:/usr/local/pgsql/bin&lt;/code&gt;&lt;/li&gt;&lt;li&gt;&lt;strong&gt;FOR THE RUBY GEM&lt;/strong&gt; I used the following code because i'm on a fricking intel mac thanks to &lt;a href="http://acts-as-blog.net/2008/3/27/building-postgresql-on-mac-os-x-leopard"&gt; acts_as_blog&lt;/a&gt;&lt;br /&gt;&lt;code&gt;sudo env ARCHFLAGS='-arch i386' gem install postgres -- \&lt;br /&gt;--with-pgsql-lib-dir=/Library/PostgreSQL/lib \&lt;br /&gt;--with-pgsql-include-dir=/Library/PostgreSQL/include&lt;/code&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Hopefully this saves someone some time and heartache!&lt;/p&gt;&lt;br /&gt;&lt;h2&gt;There is far too much to detail here...&lt;/h2&gt;&lt;br /&gt;&lt;p&gt;&lt;a href="http://acts-as-blog.net/2008/3/27/building-postgresql-on-mac-os-x-leopard"&gt; Acts_as_blog&lt;/a&gt; post has everything you need.  it should work for you. if it doesn't you need to look at creating your db user through psql.  &lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7033945969374781589-878986156890451621?l=nerbie69.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nerbie69.blogspot.com/feeds/878986156890451621/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nerbie69.blogspot.com/2009/02/postgresql-on-mac-os-x-from-source-with.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7033945969374781589/posts/default/878986156890451621'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7033945969374781589/posts/default/878986156890451621'/><link rel='alternate' type='text/html' href='http://nerbie69.blogspot.com/2009/02/postgresql-on-mac-os-x-from-source-with.html' title='PostgreSQL on Mac OS X from source, with gem!'/><author><name>nerbie69</name><uri>http://www.blogger.com/profile/00829233647136943532</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7033945969374781589.post-6516143108293108392</id><published>2009-02-06T09:42:00.000-08:00</published><updated>2009-02-07T09:11:36.268-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='rails'/><category scheme='http://www.blogger.com/atom/ns#' term='app management'/><title type='text'>My list of items to finish before the big launch.</title><content type='html'>&lt;p&gt;I just thought i'd post the items that i need to finish before i launch.   As i cross each one off of the list, i'll report back on how i tackled each problem.  Some answers may take a whole post.&lt;/p&gt;&lt;br /&gt;&lt;h2&gt;The List&lt;/h2&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;figure out up to 7 day activation period for Accounts.  Not a free trial but You have up to 7 days to activate.&lt;/li&gt;&lt;li&gt;&lt;br /&gt;add site for sale area.&lt;/li&gt;&lt;li&gt;&lt;b&gt;Completed Ranks. Moderator roles is a feature i'll add later.&lt;br /&gt;Add forum roles to forum and make extendible if needed.&lt;/b&gt;&lt;/li&gt;&lt;li&gt;&lt;br /&gt;add user google adsense code section.&lt;/li&gt;&lt;li&gt;&lt;br /&gt;When new plugins are added, I'll need to create an instantiator based on the menu items the user has selected. #how to handle old members based on a new plugin being added?  How do other sites handle it?&lt;/li&gt;&lt;li&gt;&lt;br /&gt;add body[:url] to mailer based on the current url they are on. &lt;/li&gt;&lt;li&gt;&lt;br /&gt;look into using AASM which creates a state for the accounts based on the presence of profile_id and then the current status of the user, as taken from paypal. (Users can cancel a monthly subscription on paypal, i need to know who is doing what) &lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;p&gt;Some of this shit may not make sense to you, however you will be able to tweek it to your exact situation.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7033945969374781589-6516143108293108392?l=nerbie69.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nerbie69.blogspot.com/feeds/6516143108293108392/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nerbie69.blogspot.com/2009/02/my-list-of-items-to-finish-before-big.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7033945969374781589/posts/default/6516143108293108392'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7033945969374781589/posts/default/6516143108293108392'/><link rel='alternate' type='text/html' href='http://nerbie69.blogspot.com/2009/02/my-list-of-items-to-finish-before-big.html' title='My list of items to finish before the big launch.'/><author><name>nerbie69</name><uri>http://www.blogger.com/profile/00829233647136943532</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7033945969374781589.post-5800744497319671947</id><published>2009-01-25T09:59:00.000-08:00</published><updated>2009-08-31T17:28:18.193-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='deploy'/><category scheme='http://www.blogger.com/atom/ns#' term='git'/><category scheme='http://www.blogger.com/atom/ns#' term='rails'/><category scheme='http://www.blogger.com/atom/ns#' term='capistrano'/><title type='text'>How to deploy when Capistrano doesn't work for you.</title><content type='html'>&lt;p&gt;What happens when Capistrano just doesn't work for you? &lt;/p&gt;&lt;p&gt; Ok, maybe i'm the only one with that problem, but i've tried on three different server providers, linode, gogrid and slicehost.  All had the same problem, somehow, someway my user privleges were f!@#cking it up.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;When a tutorial i've trusted tells me to put my directory to chown www-data, well, i am going to do that.  In order to do this i need to sudo everything, thanks to ubuntu, and it's a best practice i can wrap my feeble mind around.&lt;/p&gt;&lt;br /&gt;&lt;h2&gt;How to deploy a rails app when Capistrano just ain't working for you.&lt;/h2&gt;&lt;br /&gt;&lt;p&gt;I've not been able to find one source on the net that showed me simply how to deploy a web app using just git, and ssh.  So i'm open to better ways, however, i've tested this way for the last 3 weeks and am pretty happy with it.&lt;/p&gt;&lt;br /&gt;&lt;h3&gt;Prerequisites&lt;/h3&gt;&lt;br /&gt;&lt;p&gt;You are using &lt;br /&gt;&lt;ul&gt;&lt;li&gt;GIT locally and on your server&lt;/li&gt;&lt;li&gt;a full Rails setup (I'm using passanger)&lt;/li&gt;&lt;li&gt;a server that hosts both your git repository and your app&lt;/li&gt;&lt;li&gt;you've setup both your app and git repository on that server box too&lt;/li&gt; &lt;br /&gt;&lt;li&gt;You are also using www-data as the group and user who "owns" the app on the server.&lt;br /&gt;That is just too much shit to talk about right now.&lt;/li&gt;&lt;/ul&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;The code below walks you through what to do AFTER your initial setup of your server and app environment. &lt;/p&gt;&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;&lt;li&gt;On my laptop:&lt;br /&gt;&lt;br /&gt;&lt;li&gt;Make the changes to your app, when every test passes and when you are ready to go to production do the following:&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;&lt;li&gt;git status # on my machine changes appear in red.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;git add . # notice the dot after the add&lt;/li&gt;&lt;br /&gt;&lt;li&gt;git status # if you see anything in red that should also be included use the second git commit line below&lt;/li&gt;&lt;br /&gt;&lt;li&gt;git commit -m "Add your message about what your committing here." #most of the time use this&lt;/li&gt;&lt;br /&gt;&lt;li&gt;git commit -a -m "Added all files including untracked ones" # Again only use this one if there are files that appear in red and should also be included in your commit.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;git push # pushes your code to your server.&lt;/li&gt;&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;/ul&gt;&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;SSH to server, all these commands are done from your server:&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;&lt;li&gt;cd /var/your/directory/to/your/app # e.g, /var/www/myapp&lt;/li&gt;&lt;br /&gt;&lt;li&gt;sudo git pull #pulls all of your latest changes and merges them into your app.  see troubleshooting if something f@#cks up.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;sudo rake db:migrate RAILS_ENV="production" # and any other things you need to do, like start ferret or whatever.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;cd ../ # back out of this directory&lt;/li&gt;&lt;br /&gt;&lt;li&gt;sudo chown -R www-data:www-data myapp #notice that we are changing ownership of the whole myapp directory and everything below it.  Passanger loves this.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;cd myapp/&lt;/li&gt;&lt;br /&gt;&lt;li&gt;sudo touch tmp/restart.txt # how to restart passanger&lt;/li&gt;&lt;br /&gt;&lt;/code&gt;&lt;/ul&gt;&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;&lt;br /&gt;&lt;h2&gt;End&lt;/h2&gt;&lt;br /&gt;&lt;p&gt;Well i spent 2 or 3 days easily, 4 - 8 hours at a time trying to make capistrano work.  The process above takes 3 minutes.  Someone else can do the math, but in order for this way to be less efficient, i'd have to do some 300 commits before i regret not having capistrano.  One day i'll need it to deploy to 100 servers or something but for now, i can live with the process above.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7033945969374781589-5800744497319671947?l=nerbie69.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nerbie69.blogspot.com/feeds/5800744497319671947/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nerbie69.blogspot.com/2009/01/how-to-deploy-when-capistrano-doesnt.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7033945969374781589/posts/default/5800744497319671947'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7033945969374781589/posts/default/5800744497319671947'/><link rel='alternate' type='text/html' href='http://nerbie69.blogspot.com/2009/01/how-to-deploy-when-capistrano-doesnt.html' title='How to deploy when Capistrano doesn&apos;t work for you.'/><author><name>nerbie69</name><uri>http://www.blogger.com/profile/00829233647136943532</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7033945969374781589.post-284826566480447927</id><published>2009-01-21T06:42:00.000-08:00</published><updated>2009-01-24T04:57:35.703-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='plugins'/><category scheme='http://www.blogger.com/atom/ns#' term='rails'/><category scheme='http://www.blogger.com/atom/ns#' term='theme_support'/><title type='text'>theme_support and formatted routes (rss feeds)</title><content type='html'>&lt;p&gt;Today I was trying to get my web app to allow subdomains to provide an rss feed.  it didn't work.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt; I'll be posting a solution when one is found, however, i'm hoping this wasn't pebkac again.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;Solution&lt;/h2&gt;&lt;br /&gt;&lt;p&gt;In your controller, where you are making the rss call, you must render layout false.  Here is an example:&lt;br /&gt;&lt;br /&gt;&lt;code&gt;format.rss  { render :layout =&gt; false }&lt;/code&gt;&lt;br /&gt; I'll file this one under the learn something new, that is easy, everyday column.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;After some investigation, it appears that theme_support plugin doesn't support themed rss feeds, when you enter them in the head section of an html page.  I'm working to allow this in the plugin.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7033945969374781589-284826566480447927?l=nerbie69.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nerbie69.blogspot.com/feeds/284826566480447927/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nerbie69.blogspot.com/2009/01/subdomainfu-and-formatted-routes-rss.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7033945969374781589/posts/default/284826566480447927'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7033945969374781589/posts/default/284826566480447927'/><link rel='alternate' type='text/html' href='http://nerbie69.blogspot.com/2009/01/subdomainfu-and-formatted-routes-rss.html' title='theme_support and formatted routes (rss feeds)'/><author><name>nerbie69</name><uri>http://www.blogger.com/profile/00829233647136943532</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7033945969374781589.post-8704501037403010171</id><published>2009-01-10T08:27:00.000-08:00</published><updated>2009-01-10T19:07:46.173-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='controllers'/><category scheme='http://www.blogger.com/atom/ns#' term='pebkac'/><category scheme='http://www.blogger.com/atom/ns#' term='rails'/><category scheme='http://www.blogger.com/atom/ns#' term='passenger'/><title type='text'>passenger and the case of the non-redirecting account. -solved cause i'm dumb.......</title><content type='html'>&lt;p&gt;Let me explain what is going on here.  In my code I want the user to create an account (from www.domain.com) and then, upon successful creation of the account, I want them to redirect to the new account's url, at say account.domain.com.&lt;/p&gt;&lt;br /&gt;&lt;h2&gt;Redirect doesn't happen in Production&lt;/h2&gt;&lt;br /&gt;&lt;p&gt;I'm using Passenger and Apache on a ubuntu server.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;On my dev box: Mongrel from the rails app, the usual script/server stuff&lt;/p&gt;&lt;br /&gt;&lt;p&gt;So on dev, it works fine.  I get redirect with reckless abandon. &lt;/p&gt;&lt;p&gt; In production, a different story.  I get the following error (using safari, yet to try with other browsers...).&lt;code&gt;Safari can’t connect to the server.&lt;br /&gt;Safari can’t open the page “http://www.example69.com/accounts” because it could not connect to the server “www.example69.com”.&lt;/code&gt;&lt;br /&gt; Why me? I should say, I can type my new url into the browser, no problem.  it works fine, but it's not what I want my user's to have to do.&lt;/p&gt;&lt;br /&gt;&lt;h2&gt;Did you solve this?&lt;/h2&gt;&lt;br /&gt;&lt;p&gt;Embarrassingly I had a link to localhost:3000 as my redirect.  Ignore this post.  it's left as a reminder when i get too fucking cocky.... as a mark on my pride.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7033945969374781589-8704501037403010171?l=nerbie69.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nerbie69.blogspot.com/feeds/8704501037403010171/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nerbie69.blogspot.com/2009/01/passenger-and-case-of-non-redirecting.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7033945969374781589/posts/default/8704501037403010171'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7033945969374781589/posts/default/8704501037403010171'/><link rel='alternate' type='text/html' href='http://nerbie69.blogspot.com/2009/01/passenger-and-case-of-non-redirecting.html' title='passenger and the case of the non-redirecting account. -solved cause i&apos;m dumb.......'/><author><name>nerbie69</name><uri>http://www.blogger.com/profile/00829233647136943532</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7033945969374781589.post-3202373281605347469</id><published>2008-12-26T15:30:00.000-08:00</published><updated>2008-12-26T16:19:27.009-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='tether'/><category scheme='http://www.blogger.com/atom/ns#' term='Apple'/><category scheme='http://www.blogger.com/atom/ns#' term='iphone'/><title type='text'>3 reasons to hate your new iphone</title><content type='html'>&lt;p&gt;As much as I'd like to say I'm 100% happy with my iphone, i must confess that I am not 100% happy with the iphone at all.  The post that follows outlines the three reasons why I am not too happy with my iphone:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;You MUST jailbreak your iphone, in order to do anything cool with it&lt;/li&gt;&lt;li&gt;Lack of bluetooth functionality when synced to macbook&lt;/li&gt;&lt;li&gt;Apple's general malaise with bending over to the Telco's&lt;/li&gt;&lt;/ol&gt;&lt;/p&gt;&lt;br /&gt;&lt;h2&gt;&lt;/h2&gt;&lt;br /&gt;&lt;p&gt;In Canada, did you know that you are allowed to tether your iphone to your laptop.  It's a selling feature to idiots like me who commute and aren't always at a wireless connection, and the thought of 3G surfing to improve your &lt;a href="http://www.prodrock.com/"&gt;ruby on rails app&lt;/a&gt; got you off, big time.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;The one little wee bit of information no one told you, until you shelled out the money and signed the contract, was that unless you jailbreak your iphone, Apple doesn't have a legal app to allow you to connect via bluetooth to your laptop.  It's this lack of Tethering Ability that burnt my britches.  I feel it's the man stain on an otherwise pristinely made bed, and i was told to sleep in it.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Now, why must a consumer be forced to jailbreak an iphone, when HE/SHE doesn't want to.  I have no desire to do anything like this, nor should a consumer be asked to.  He/she gets home, clicks the App Store app and prays to find a tethering app.  He/she doesn't.  He/she's choice: Jailbreak and risk bricking the phone or surf via Safari on iphone instead of being able to git push from your macbook, which is what i want to do in the first place.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;One company had balls.  &lt;a href="http://www.nullriver.com/"&gt;NullRiver&lt;/a&gt;.  I used their &lt;a href="http://www.nullriver.com/products/medialink"&gt;MediaLink&lt;/a&gt; app to connect to my PS3.  Really good stuff, cause it just works.  However, &lt;a href "http://www.nullriver.com/home/news"&gt;at last check (story Sept 13, 2008)&lt;/a&gt; they had their app pulled down from the App store by Apple.&lt;/p&gt;&lt;br /&gt;&lt;h2&gt;Lack of bluetooth functionality when synced to macbook&lt;/h2&gt;&lt;br /&gt;&lt;p&gt;Seriously, when you sync up your iphone to your macbook/imac and get that going, did you know that there is nothing you really can do through bluetooth?  Maybe in the future, there will be skads of things to do, but generally, you can't do sh!t out of the box, legally.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Users of the "lesser" phones may be shocked to hear that you can't even file transfer via bluetooth from your macbook to your iphone.  I believe my first samsung in 2000 had that ability.  &lt;/p&gt;&lt;br /&gt;&lt;h2&gt;Apple's general malaise with bending over to the Telco's&lt;/h2&gt;&lt;br /&gt;&lt;p&gt;Now i'm a pretty loyal Apple customer.  I've got a whole family on imac's or macbooks, a few on iphones, one on AppleTV even.  I'm no fanboy who makes the trip to hear Steve Job's speak at MacWorld, I've never read an apple based blog nor do i have an account on &lt;a href="http://www.ehmac.ca/"&gt;ehmac&lt;/a&gt; either, but i do troll on the #mac channel often, in IRC.  So my heart is with Apple.  Linux was too nerdy for me, windows... is... well, windows, so Apple is the only OS that i can tolerate, have fun with and still feel secure.  I also like their attitude.  Here we are.  like it or not, this is Apple.  You don't like it, that's fine, there are alternatives out there for you. &lt;/p&gt;&lt;br /&gt;&lt;p&gt;So how can a company with this hipster attitude, take it large from a couple of stupid Ma Bell castaway TeleCom companies?  Or worse, a Canadian provider!?!?!  Grow a set of balls, force these babies to allow their users to surf the 3G network via their laptop, bluetoothily through their iphone.  For the amount of people that would do it, and i doubt it would be that many, as most people surf walking in a mall or at a friends house when they say "Hey, look i got an iphone and i can surf for porn from your bathroom!"&lt;/p&gt;&lt;br /&gt;&lt;h2&gt;So what can be done nerbie69?&lt;/h2&gt;&lt;br /&gt;&lt;p&gt;I'm glad you asked.  Nothing can be done, except get NullRiver's app back onto the AppStore.  There is no reason for it not to be there. Also, make sure it is priced around the $29 - $49 mark.  People are nothing but cheap and this price point will allow only those who really need it to buy it.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;The Telco relationship won't change.  Money grubbing won't change, but Apple you can price the NullRiver app accordingly so that you keep your loyal fans happy and still save face with the skidmarks from the Telco world who are trying too desperatley, like an actress getting her 12 face lift, to keep their looks and cool.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7033945969374781589-3202373281605347469?l=nerbie69.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nerbie69.blogspot.com/feeds/3202373281605347469/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nerbie69.blogspot.com/2008/12/3-reasons-to-hate-your-new-iphone.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7033945969374781589/posts/default/3202373281605347469'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7033945969374781589/posts/default/3202373281605347469'/><link rel='alternate' type='text/html' href='http://nerbie69.blogspot.com/2008/12/3-reasons-to-hate-your-new-iphone.html' title='3 reasons to hate your new iphone'/><author><name>nerbie69</name><uri>http://www.blogger.com/profile/00829233647136943532</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7033945969374781589.post-125767645316008105</id><published>2008-12-20T10:09:00.000-08:00</published><updated>2008-12-20T10:28:57.323-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='plugins'/><category scheme='http://www.blogger.com/atom/ns#' term='controllers'/><category scheme='http://www.blogger.com/atom/ns#' term='engines'/><category scheme='http://www.blogger.com/atom/ns#' term='errors'/><title type='text'>Solved: ApplicationController has been removed from the module tree error.</title><content type='html'>&lt;p&gt;&lt;code&gt;A copy of ApplicationController has been removed from the module tree but is still active!&lt;/code&gt;&lt;br /&gt; You got this error... and now you don't know what to do.  Well i can offer a suggestion or two on how to fix it.&lt;/p&gt;&lt;object width="425" height="344"&gt;&lt;param name="movie" value="http://www.youtube.com/v/Of9BL_LlCWM&amp;hl=en&amp;fs=1"&gt;&lt;/param&gt;&lt;param name="allowFullScreen" value="true"&gt;&lt;/param&gt;&lt;param name="allowscriptaccess" value="always"&gt;&lt;/param&gt;&lt;embed src="http://www.youtube.com/v/Of9BL_LlCWM&amp;hl=en&amp;fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;h2&gt;Symptoms&lt;/h2&gt;&lt;br /&gt;&lt;p&gt;You may be trying to update a plugin that is conflicting with ApplicationController.  You'll also notice that this error happens when you try to reload the same page, or even move a different view within the same directory.  For instance, if you load plugin/index and the try to reload OR go to another link  say plugin/new, you get this error.&lt;/p&gt;&lt;br /&gt;&lt;h2&gt;Hit me nerbie69!  Solve my problems&lt;/h2&gt;&lt;br /&gt;&lt;p&gt;Well dude, you got way too many for me to solve, but this one is on me.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;All douchery aside, i solved my error by deleting some of the leftover cruft of having a generator plugin, that i converted into a engines based plugin.  &lt;a href="http://github.com/nerbie69/railstat/tree/master"&gt;github nerbie69/railstat plugin&lt;/a&gt; check out the forked project for the current generator based script.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;code&gt;#OLD code&lt;br /&gt;require_dependency 'path_tracker'&lt;br /&gt;&lt;br /&gt;class RailStatController &lt; ApplicationController&lt;br /&gt;  include PathTracker&lt;br /&gt;&lt;br /&gt;  before_filter :extract_subdomain&lt;br /&gt;....&lt;br /&gt;&lt;/code&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;code&gt; #new code notice the difference&lt;br /&gt;class RailStatController &lt; ApplicationController&lt;br /&gt;  unloadable&lt;br /&gt;  include PathTracker&lt;br /&gt;&lt;br /&gt;  before_filter :extract_subdomain&lt;br /&gt;...&lt;/code&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt; Since ApplicationController is an unloadable class, we too had to match it's unloadability in our app/controllers directory of our engines based plugin.  Also, we don't need the require statement, as you do when you are using a generator plugin, if you are referencing the lib directory.  The engines takes care of that for you too.&lt;/p&gt;&lt;br /&gt;&lt;h2&gt;Wrap it up Johnny!&lt;/h2&gt;&lt;br /&gt;&lt;p&gt;Ok, engines rock.  Also, you can apply this code to any of these stupid errors you might get in the future for other controllers and plugins.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;small&gt;Sources: &lt;a href="http://dev.rubyonrails.org/ticket/6001"&gt;rails trac from 2006. &lt;/a&gt;&lt;/small&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7033945969374781589-125767645316008105?l=nerbie69.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nerbie69.blogspot.com/feeds/125767645316008105/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nerbie69.blogspot.com/2008/12/solved-applicationcontroller-has-been.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7033945969374781589/posts/default/125767645316008105'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7033945969374781589/posts/default/125767645316008105'/><link rel='alternate' type='text/html' href='http://nerbie69.blogspot.com/2008/12/solved-applicationcontroller-has-been.html' title='Solved: ApplicationController has been removed from the module tree error.'/><author><name>nerbie69</name><uri>http://www.blogger.com/profile/00829233647136943532</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7033945969374781589.post-4976264124572031838</id><published>2008-12-16T19:47:00.001-08:00</published><updated>2008-12-16T20:07:55.721-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='plugins'/><category scheme='http://www.blogger.com/atom/ns#' term='rails'/><category scheme='http://www.blogger.com/atom/ns#' term='engines'/><category scheme='http://www.blogger.com/atom/ns#' term='generator'/><title type='text'>Rails Engines are awesome!!!!</title><content type='html'>&lt;p&gt;Some of my loyal fans may be shocked to know that i just tried the &lt;a href"http://rails-engines.org/"&gt;Rails Engines&lt;/a&gt; plugin.  Officially titled &lt;a href="git://github.com/lazyatom/engines.git"&gt;engines plugin on github&lt;/a&gt;.&lt;/p&gt;&lt;br /&gt;&lt;h2&gt;So easy, and exactly as advertised&lt;/h2&gt;&lt;br /&gt;&lt;p&gt;Sometimes, try as we may, things aren't always as advertised in this community of ours.  So it is a good when things go exactly as planned&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Instructions on using the plugin are well written in the README, so i won't bore you with those details, but if you have ever wanted to make a plugin that had the same familiar structure as your rails app', then this is for you.   All you need to do is create a plugin and then add the same app directory structure in the root folder of the plugin.&lt;/p&gt;&lt;br /&gt;&lt;h2&gt;Predictions&lt;/h2&gt;&lt;br /&gt;&lt;p&gt;Theoretically you can make all of your controller, models and views as plugins, making your app act almost like it's own SAAS appliance.  If you have a generator style'd plugin, there is no reason not to use engines.  Less coding for you, the plugin creator.&lt;/p&gt;&lt;br /&gt;&lt;h2&gt;Examples of Hot Rails Engines Action (HREA?)&lt;/h2&gt;&lt;br /&gt;&lt;p&gt;In fact, i just put the finishing touches on my fork of the &lt;a href"git://github.com/nerbie69/railstat.git"&gt;rails stat&lt;/a&gt; plugin, that was purely a generator script, basically.  Now in my forked version, the engines plugin takes care of generating static code within an app.  And that is pretty frickin cool.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7033945969374781589-4976264124572031838?l=nerbie69.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nerbie69.blogspot.com/feeds/4976264124572031838/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nerbie69.blogspot.com/2008/12/rails-engines-are-awesome.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7033945969374781589/posts/default/4976264124572031838'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7033945969374781589/posts/default/4976264124572031838'/><link rel='alternate' type='text/html' href='http://nerbie69.blogspot.com/2008/12/rails-engines-are-awesome.html' title='Rails Engines are awesome!!!!'/><author><name>nerbie69</name><uri>http://www.blogger.com/profile/00829233647136943532</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7033945969374781589.post-9062506176840848199</id><published>2008-12-13T07:52:00.000-08:00</published><updated>2008-12-13T19:47:13.417-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='plugins'/><category scheme='http://www.blogger.com/atom/ns#' term='rails'/><category scheme='http://www.blogger.com/atom/ns#' term='generator'/><title type='text'>Working with Generators in Rails - Lessons Learned the hard way.</title><content type='html'>&lt;p&gt;I'm updating a plugin that works in Rails 2.2.2 development, yet borks in a production site using 2.1.0.&lt;br /&gt;&lt;br /&gt;&lt;code&gt;undefined method `render' for #  Rails::Generator::Commands::Create:0x7fdf1caaa2c8 &lt;/code&gt;&lt;/p&gt;&lt;br /&gt;&lt;h2&gt;right now, Here is what the problem was&lt;/h2&gt;&lt;br /&gt;&lt;p&gt;in my generator script i had the usual code &lt;br /&gt;&lt;code&gt;      m.template "app/views/rail_stat/hits.rhtml", "app/views/rail_stat/hits.rhtml"&lt;br /&gt;      m.template "app/views/rail_stat/lang.rhtml", "app/views/rail_stat/lang.rhtml"&lt;/code&gt;&lt;/p&gt;&lt;p&gt;Now inside of hits.rhtml is the following line &lt;br /&gt;&lt;code&gt;&lt; %= render :partial =&gt; 'menu' % &gt;&lt;/code&gt;&lt;/p&gt;&lt;p&gt;For some reason the render part fudges everything up.  if i delete that line, the files go through with no problem.&lt;/p&gt;&lt;br /&gt;&lt;h2&gt;Solution&lt;/h2&gt;&lt;br /&gt;&lt;p&gt;When generating erb templates, the Rails::Generator needs to use an extra percentage sign whenever you call specific erb calls.  For instance, i only had used &lt;code&gt;&lt; %= render :partial =&gt; 'menu' % &gt;&lt;/code&gt; but i should have used &lt;code&gt;&lt; %%= render :partial =&gt; 'menu' % &gt;&lt;/code&gt; &lt;br /&gt;  Again, notice the extra %  percentage sign in the second code bit.  I'm sure there may be a better reason but the second % sign acts almost as a buffer and tells m.template to print the erb code in the new file?  Again, that may be too simplistic of an answer, but that is what it seems like to me.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7033945969374781589-9062506176840848199?l=nerbie69.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nerbie69.blogspot.com/feeds/9062506176840848199/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nerbie69.blogspot.com/2008/12/working-with-generators-in-rails.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7033945969374781589/posts/default/9062506176840848199'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7033945969374781589/posts/default/9062506176840848199'/><link rel='alternate' type='text/html' href='http://nerbie69.blogspot.com/2008/12/working-with-generators-in-rails.html' title='Working with Generators in Rails - Lessons Learned the hard way.'/><author><name>nerbie69</name><uri>http://www.blogger.com/profile/00829233647136943532</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7033945969374781589.post-5317286163225341052</id><published>2008-12-09T11:00:00.000-08:00</published><updated>2008-12-09T14:41:10.599-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='plugins'/><category scheme='http://www.blogger.com/atom/ns#' term='rails'/><category scheme='http://www.blogger.com/atom/ns#' term='theme_support'/><title type='text'>Finally. Theme_Support fully Working in Rails 2.2.2</title><content type='html'>&lt;p&gt; I feel like singing.  That is how happy i am.&lt;/p&gt;&lt;object width="425" height="344"&gt;&lt;param name="movie" value="http://www.youtube.com/v/GLTGoDsps68&amp;hl=en&amp;fs=1"&gt;&lt;/param&gt;&lt;param name="allowFullScreen" value="true"&gt;&lt;/param&gt;&lt;param name="allowscriptaccess" value="always"&gt;&lt;/param&gt;&lt;embed src="http://www.youtube.com/v/GLTGoDsps68&amp;hl=en&amp;fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;br /&gt;&lt;h2&gt;Theme_support plugin for rails is fully working in Rails 2.2.2&lt;/h2&gt;&lt;br /&gt;&lt;p&gt;I'll work with jystewart from github to get the fix onto his version, as that is what i got to work. Here is the link to &lt;a href="http://github.com/nerbie69/theme_support/tree/master"&gt;Theme_support on github&lt;/a&gt;.  Alegria!&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7033945969374781589-5317286163225341052?l=nerbie69.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nerbie69.blogspot.com/feeds/5317286163225341052/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nerbie69.blogspot.com/2008/12/finally-themesupport-fully-working-in.html#comment-form' title='9 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7033945969374781589/posts/default/5317286163225341052'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7033945969374781589/posts/default/5317286163225341052'/><link rel='alternate' type='text/html' href='http://nerbie69.blogspot.com/2008/12/finally-themesupport-fully-working-in.html' title='Finally. Theme_Support fully Working in Rails 2.2.2'/><author><name>nerbie69</name><uri>http://www.blogger.com/profile/00829233647136943532</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>9</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7033945969374781589.post-4203974477435957401</id><published>2008-12-05T20:24:00.000-08:00</published><updated>2008-12-06T15:56:37.784-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='server'/><category scheme='http://www.blogger.com/atom/ns#' term='rails'/><category scheme='http://www.blogger.com/atom/ns#' term='app management'/><title type='text'>Transferring an existing app to a new server</title><content type='html'>&lt;p&gt;Let the good times roll gents.  Rick Okasik and the cars once sang that song about this exact moment in time.  The day I transferred my existing ruby on rails site from a shared host to slicehost.&lt;/p&gt;&lt;object width="425" height="344"&gt;&lt;param name="movie" value="http://www.youtube.com/v/VqmejG6xgDs&amp;hl=en&amp;fs=1"&gt;&lt;/param&gt;&lt;param name="allowFullScreen" value="true"&gt;&lt;/param&gt;&lt;param name="allowscriptaccess" value="always"&gt;&lt;/param&gt;&lt;embed src="http://www.youtube.com/v/VqmejG6xgDs&amp;hl=en&amp;fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;br /&gt;&lt;h2&gt;Preamble - Reasons why, etc...&lt;/h2&gt;&lt;br /&gt;&lt;p&gt;My shared hosting account at a2 has come to an end.  They have been having a couple of days worth of outages here and there.  Nothing too bad, usual disk failure kinds of stuff, but what really got my goat was this.  A bug in cpanel that didn't allow the mongrel server to restart.  So my site would be down for an eon, because they restarted the server or apache or something (never got straight answers).  Now i'm a patient guy, but in terms of my website as a business, they were messing with my livelyhood.  Good intentions or not, it sucked for that reason.  &lt;/p&gt;&lt;br /&gt;&lt;p&gt;So the time has come to grow up and move to &lt;a href="https://manage.slicehost.com/customers/new?referrer=6cdaf9ba7ab7d936087a6d8794c382a5"&gt;slicehost&lt;/a&gt;.  I've tried Linode but i prefer &lt;a href="https://manage.slicehost.com/customers/new?referrer=6cdaf9ba7ab7d936087a6d8794c382a5"&gt;slicehost&lt;/a&gt;.  Both really offer the same principle offerings and are strictly/typically linux based servers, so i liked these two.  But for some reason, &lt;a href="https://manage.slicehost.com/customers/new?referrer=6cdaf9ba7ab7d936087a6d8794c382a5"&gt;slicehost&lt;/a&gt; resonated more with me.  Just a thing i have, no fault of anyones.&lt;/p&gt;&lt;br /&gt;&lt;h2&gt;Steps involved in transferring an existing app to a new server&lt;/h2&gt;&lt;br /&gt;&lt;p&gt;I'll be chronicling my journey through transferring a rails app from a shared host to a VPS like slicehost.  Here are the steps I took to move the server:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Backed up MySQL database on old server&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Ftp'd backup db to new server&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Copied app code to new server&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Imported DB onto new server&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Fixed app settings to let it run properly, such as action mailer, etc.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Updated DNS records to reflect the switch.&lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;For the record, i already have a working passanger/mail system/rails stack on slicehost.  I will chronicle what I needed to do to get this to work.  However, your mileage may vary and if you screw up anything, even because of my instructions, i'm sorry, but that's on you and i won't and can't be held responsible.  You've been warned.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Good, got that crap out of the way, on with the show.&lt;/p&gt;&lt;br /&gt;&lt;h2&gt;Export Mysql database from old server&lt;/h2&gt;&lt;br /&gt;&lt;p&gt;I followed this &lt;a href="http://articles.slicehost.com/2008/7/29/mysql-exporting-and-importing-databases"&gt;Slicehost article on exporting and importing db's&lt;/a&gt;.  It was pretty easy so far.&lt;/p&gt;&lt;br /&gt;&lt;h2&gt;Zip code on OLD server&lt;/h2&gt;&lt;br /&gt;&lt;p&gt;As i'm using the command line for all/most of this transfer, a great resource for zipping files was &lt;a href="http://linux.about.com/od/commands/l/blcmdl1_zip.htm"&gt;About.com&lt;/a&gt;.  Although not as sexy to use, it had all i needed.  I used the following commands:&lt;br /&gt;&lt;br /&gt;&lt;code&gt;zip -r app_new app -x \*.log&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;Notice the -x which will exclude your stupidly huge log files.  I need to find a better way to manage them.  &lt;/p&gt;&lt;small&gt;By the way i went from 40mb zip file with logs to 10.5mb zip file.  need i say more&lt;/small&gt;&lt;br /&gt;&lt;h2&gt;FTP code and .sql file to New Server&lt;/h2&gt;&lt;br /&gt;&lt;p&gt;No explanation really needed here. I used ftp from old server to my desktop and then i  used sftp onto new server at slicehost.  Your mileage may vary, but you get the idea.&lt;/p&gt;&lt;br /&gt;&lt;h2&gt;Unzip code into new /var/sites/ directory&lt;/h2&gt;&lt;br /&gt;&lt;p&gt; I unzipped the code into a web-applicaton chmod'd directory.&lt;br /&gt;&lt;code&gt;unzip app.zip&lt;/code&gt;&lt;/p&gt;&lt;br /&gt;&lt;h2&gt;Import DB.sql file into the NEW Server&lt;/h2&gt;  &lt;br /&gt;&lt;p&gt;The &lt;a href="http://articles.slicehost.com/2008/7/29/mysql-exporting-and-importing-databases"&gt;Slicehost article on exporting and importing db's&lt;/a&gt; again came in handy here.  So easy, so good. &lt;/p&gt;&lt;br /&gt;&lt;h2&gt;Setup your new DB user&lt;/h2&gt;&lt;br /&gt;&lt;p&gt;I ended up creating a new user, just to be safe.  Probably no need to do this, as you can keep the same one from your old server, but just in case.  I just followed this &lt;a href="http://articles.slicehost.com/2008/7/10/mysql-creating-and-editing-users"&gt;Slicehost article on creating Mysql users&lt;/a&gt;.  Grant All privleges, as he shows in the article.&lt;/p&gt;&lt;br /&gt;&lt;h2&gt;install all your outstanding gems&lt;/h2&gt;&lt;br /&gt;&lt;p&gt;Since i forgot which gems i need, and I am not ready to upgrade this app to 2.2.2 yet, as it's in rails 2.0.2, I need to go to the old server, and pull off all the gems i used, and reinstall them on the NEW server.  Once this is done, we can setup the config files for actionmailer and the db itself.&lt;/p&gt;&lt;p&gt;Well it looks like it's the old rmagick gem that was the troublsome one.  Thanks to &lt;a href="http://www.enrailed.net/2008/05/02/installing-imagemagick-rmagick-on-ubuntu-hardy-heron/"&gt;enrailed.net for helping me out with this one&lt;/a&gt;.  It's weird to me how i followed the same steps using aptitude and I got an error, but if i use apt-get, i was fine...  whatever eh!  Oh and gem install rails -v 2.0.2 just hung there, so i said screw it, and i'm going to go with the one i have on there 2.1.2.&lt;/p&gt;&lt;p&gt;Lastly for all &lt;b&gt;UBUNTU Hardy&lt;/b&gt; users that don't know.... update your ruby gems.  the POS that is shipped with that ubuntu version will disappoint you, if it hasn't already.  Thanks to Mike's post &lt;a href="http://afreshcup.com/2008/10/25/rails-212-and-22rc1-update-your-rubygems/"&gt;here at a fresh cup blog&lt;/a&gt;  you'll find out how more.  Simply put, just run &lt;br /&gt;&lt;code&gt;sudo gem install rubygems-update  &lt;br /&gt;sudo update_rubygems &lt;/code&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;Update Config and database files&lt;/h2&gt;&lt;br /&gt;&lt;p&gt;so you'll need to update anything in your config/environment.rb file that was server specific, such as actionmailer settings.  Also, make sure your config/database.yml file reflects your NEW database.&lt;/p&gt;&lt;br /&gt;&lt;h2&gt;Update your server settings&lt;/h2&gt;&lt;br /&gt;&lt;p&gt;I, like most of the free rails world, are now using passanger to serve our app.  If you aren't, run, don't walk, to the nearest passanger downloading station and fricking do it!  Mongrel's time has passed, much like zed shaw's rants.  It meets my needs, that is for sure.&lt;/p&gt;&lt;p&gt;I added  the following code to passanger:&lt;br /&gt;&lt;code&gt;&lt;VirtualHost *:80&gt;&lt;br /&gt;  ServerName sitename.com&lt;br /&gt;  ServerAlias www.sitename.com&lt;br /&gt;  DocumentRoot /var/rails/sitename/public&lt;br /&gt;&lt;/VirtualHost&gt;&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;Since i have two other sites on my slice, i need to make sure that the NameVirtualHost *.80 is only added to the "first" site or in other words, only once.&lt;/p&gt;  &lt;small&gt; The best passanger, slice from scratch tutorial is &lt;a href="http://www.sysadminschronicles.com/2008/5/13/ubuntu-8-04-rails-server-using-passenger-part-2"&gt;Part One and Two of sys admin chronicles&lt;/a&gt;.&lt;/small&gt;&lt;br /&gt;&lt;h2&gt;Change your DNS records on your slice and with your Registrar&lt;/h2&gt;&lt;br /&gt;&lt;p&gt;You'll need to change where your DNS is pointed, i.e., from the OLD server to the NEW one.  &lt;a href="https://manage.slicehost.com/customers/new?referrer=6cdaf9ba7ab7d936087a6d8794c382a5"&gt;Slicehost&lt;/a&gt; makes that part easy with their DNS manager.  For the registrar part, you need to go to the registrar of record, in order to point it to the new settings.  I change the registrar's record first, then i change mine on slicehost.  But again, that's what i've done.&lt;/p&gt;&lt;br /&gt;&lt;h2&gt;Restart the App and you are done&lt;/h2&gt;&lt;br /&gt;&lt;p&gt;I think that is it friends.  You should have the same app as you had before working on a new server.  This wasn't rocket-science but it was a good list of 'things you need to do' when converting over to a new server.&lt;/p&gt;&lt;br /&gt;&lt;h2&gt;To do...&lt;/h2&gt;&lt;br /&gt;&lt;p&gt;I'll post how i got a multi-website postfix configuration going on my slice.  I've yet to find an easy tutorial that works... but i'm looking.  Thanks everyone.  The good times are rolling again.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7033945969374781589-4203974477435957401?l=nerbie69.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nerbie69.blogspot.com/feeds/4203974477435957401/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nerbie69.blogspot.com/2008/12/transferring-existing-app-to-new-server.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7033945969374781589/posts/default/4203974477435957401'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7033945969374781589/posts/default/4203974477435957401'/><link rel='alternate' type='text/html' href='http://nerbie69.blogspot.com/2008/12/transferring-existing-app-to-new-server.html' title='Transferring an existing app to a new server'/><author><name>nerbie69</name><uri>http://www.blogger.com/profile/00829233647136943532</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7033945969374781589.post-4507379286088730593</id><published>2008-12-03T17:40:00.000-08:00</published><updated>2008-12-04T11:35:47.607-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='plugins'/><category scheme='http://www.blogger.com/atom/ns#' term='rails'/><category scheme='http://www.blogger.com/atom/ns#' term='theme_support'/><title type='text'>Theme Support plugin update for Rails 2.2- Part 2.</title><content type='html'>&lt;p&gt;So i have tried my damnedest to make this work. I get an error as follows:&lt;/p&gt;&lt;p&gt;&lt;code&gt;undefined method `compute_public_path' for #&lt;ActionView::Base:0x37cb78c&gt;&lt;/code&gt;&lt;br /&gt;So, for some reason in theme support i am getting this crazy error, where in Rails 2.0.2 i did not, and in another project, which was Rails 2.1.2 using the "old" theme support, i did not get either&lt;/p&gt;&lt;br /&gt;&lt;h2&gt;Possible Solution (TBD)&lt;/h2&gt;&lt;p&gt;It appears that the compute_public_path method is now a private method of the class AssetTag in the module ActionView::Helpers::AssetTagHelpers.  &lt;/p&gt;&lt;h2&gt; What I still need to figure out&lt;/h2&gt;&lt;br /&gt;&lt;p&gt;How in the hell do i link this 'sub class' AssetTag to the Module line in the rhtml_helpers.rb file in theme_support?  I've tried various configurations to no avail.  Who out there is a plugin god and can help out?&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7033945969374781589-4507379286088730593?l=nerbie69.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nerbie69.blogspot.com/feeds/4507379286088730593/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nerbie69.blogspot.com/2008/12/theme-support-plugin-update-for-rails_03.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7033945969374781589/posts/default/4507379286088730593'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7033945969374781589/posts/default/4507379286088730593'/><link rel='alternate' type='text/html' href='http://nerbie69.blogspot.com/2008/12/theme-support-plugin-update-for-rails_03.html' title='Theme Support plugin update for Rails 2.2- Part 2.'/><author><name>nerbie69</name><uri>http://www.blogger.com/profile/00829233647136943532</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7033945969374781589.post-7252352125128291529</id><published>2008-12-02T07:30:00.001-08:00</published><updated>2008-12-02T07:41:28.175-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='plugins'/><category scheme='http://www.blogger.com/atom/ns#' term='rails'/><category scheme='http://www.blogger.com/atom/ns#' term='theme_support'/><title type='text'>Theme Support plugin update for Rails 2.2</title><content type='html'>&lt;p&gt;&lt;b&gt;Commentary:&lt;/b&gt; This plugin always has to be updated after every version of a rails upgrade?  I don't know why that is however?  Perhaps it's the most unluckiest of plugins?  carma?  something... but like a trooper, it keeps on licking and ticking.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;If you are using theme support and have recently upgraded your app to 2.2, you'll need to fix this plugin before you get anywhere.  luckily jystewart from github has patched the plugin to work with 2.2.  from what i see it may even fix it for a while, so that finally we won't have to keep patching this thing. &lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;URL: &lt;a href="http://github.com/jystewart/theme_support/tree/master"&gt;http://github.com/jystewart/theme_support/tree/master&lt;/a&gt;&lt;/h2&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7033945969374781589-7252352125128291529?l=nerbie69.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nerbie69.blogspot.com/feeds/7252352125128291529/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nerbie69.blogspot.com/2008/12/theme-support-plugin-update-for-rails.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7033945969374781589/posts/default/7252352125128291529'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7033945969374781589/posts/default/7252352125128291529'/><link rel='alternate' type='text/html' href='http://nerbie69.blogspot.com/2008/12/theme-support-plugin-update-for-rails.html' title='Theme Support plugin update for Rails 2.2'/><author><name>nerbie69</name><uri>http://www.blogger.com/profile/00829233647136943532</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7033945969374781589.post-2718181896576010263</id><published>2008-11-29T06:07:00.000-08:00</published><updated>2008-11-29T06:34:09.120-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='rails'/><category scheme='http://www.blogger.com/atom/ns#' term='tips'/><category scheme='http://www.blogger.com/atom/ns#' term='update'/><title type='text'>Updating Rails app from 2.0.2 to 2.2.2</title><content type='html'>&lt;p&gt;Ahh the fun begins.  In this post you will find the 'gotchas' I had with updating an existing established app from rails version 2.0.2 to the new version of 2.2.2.&lt;/p&gt;&lt;br /&gt;&lt;h2&gt;Cache_template_extensions Error&lt;/h2&gt;&lt;br /&gt;&lt;p&gt;Here is the partial stack error &lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;code&gt;/Users/nerb/.gem/ruby/1.8/gems/rails-2.2.2/lib/initializer.rb:530:in `send': undefined method `cache_template_extensions=' for ActionView::Base:Class (NoMethodError)&lt;br /&gt;&lt;/code&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;b&gt;Solution!&lt;/b&gt; - There was mention of an error at line 15 of my environment.rb file.  I went to the environments/development.rb and deleted the line &lt;br /&gt;&lt;code&gt;config.action_view.cache_template_extensions         = false&lt;/code&gt;  I read on the interweb that this cache_template_extensions no longer is used or is has been deleted.&lt;/p&gt;&lt;br /&gt;&lt;h2&gt;Now maybe the time to update Plugins.&lt;/h2&gt;&lt;br /&gt;&lt;p&gt;As a public service, I wonder if now is the time to update your plugins, if it's been awhile.  Some may never change (Acts_as_tree), but some change fairly rapidly (Restful_authentication).&lt;/p&gt;&lt;br /&gt;&lt;p&gt;For Restful Authentication, I know there is a new password feature that doesn't jive with the old passwords.  However, since I also need to update this plugin, I wonder if it's better to scrap the --old-passsword flag and investigate why the new way is better?  Could it be that I may change all of the current user's passwords on my site?  Only if there is a dang good reason. A dang good one.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7033945969374781589-2718181896576010263?l=nerbie69.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nerbie69.blogspot.com/feeds/2718181896576010263/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nerbie69.blogspot.com/2008/11/updating-rails-app-from-202-to-222.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7033945969374781589/posts/default/2718181896576010263'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7033945969374781589/posts/default/2718181896576010263'/><link rel='alternate' type='text/html' href='http://nerbie69.blogspot.com/2008/11/updating-rails-app-from-202-to-222.html' title='Updating Rails app from 2.0.2 to 2.2.2'/><author><name>nerbie69</name><uri>http://www.blogger.com/profile/00829233647136943532</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7033945969374781589.post-4495781994924203769</id><published>2008-11-23T10:27:00.000-08:00</published><updated>2008-12-02T07:41:46.408-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='plugins'/><category scheme='http://www.blogger.com/atom/ns#' term='pebkac'/><category scheme='http://www.blogger.com/atom/ns#' term='tips'/><category scheme='http://www.blogger.com/atom/ns#' term='acts as ferret'/><title type='text'>Acts as ferret : only have one instance per development computer...</title><content type='html'>&lt;h2&gt;Symptoms&lt;/h2&gt;&lt;br /&gt;&lt;p&gt;I kept getting this stupid error&lt;br /&gt;&lt;code&gt;(druby://localhost:9010) /Users/nerb/.gem/ruby/1.8/gems/activesupport-2.1.2/lib/active_support/dependencies.rb:279:in `load_missing_constant': uninitialized constant Browser (NameError)&lt;br /&gt;&lt;/code&gt;&lt;/p&gt;&lt;br /&gt;&lt;h2&gt;How to solve this error&lt;/h2&gt;&lt;br /&gt;&lt;p&gt;Basically I got this error because Acts as ferret was running in another app on my development box.  Just do a simple &lt;code&gt;script/ferret_server stop&lt;/code&gt; in the OLD app. Return to the new app and start the ferret server by doing &lt;code&gt;script/ferret_server start&lt;/code&gt; &lt;/p&gt;&lt;br /&gt;&lt;p&gt;Hell, i thought it had to do with my recent updating of rails to 2.2.2, however, it did not.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7033945969374781589-4495781994924203769?l=nerbie69.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nerbie69.blogspot.com/feeds/4495781994924203769/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nerbie69.blogspot.com/2008/11/acts-as-ferret-only-have-one-instance.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7033945969374781589/posts/default/4495781994924203769'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7033945969374781589/posts/default/4495781994924203769'/><link rel='alternate' type='text/html' href='http://nerbie69.blogspot.com/2008/11/acts-as-ferret-only-have-one-instance.html' title='Acts as ferret : only have one instance per development computer...'/><author><name>nerbie69</name><uri>http://www.blogger.com/profile/00829233647136943532</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7033945969374781589.post-3362465844267425230</id><published>2008-11-21T15:03:00.000-08:00</published><updated>2008-12-02T07:42:01.309-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='pebkac'/><title type='text'>Serialize... what the #@#&amp;%!!?</title><content type='html'>Ok.  For all my loyal readers, here is one thing that just wasn't jiving for me.&lt;br /&gt;&lt;h2&gt;Serialize is Killing me!&lt;/h2&gt;&lt;br /&gt;&lt;br /&gt;Serialize :column is code that should be put into  your model.&lt;br /&gt;&lt;br /&gt;What that little line does is save whatever code you save to that column as yaml.  Oh and make sure :column is a type :string.&lt;br /&gt;&lt;br /&gt;Without doing anything to the column upon saving, this is an example of what could be in your db.&lt;br /&gt;&lt;br /&gt;&lt;code&gt;column: "--- \n- subscription\n- membership\n"&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;Now supposedly, all i  have to do to use this string of yaml is to call it like i normally would, say in a for loop, and it 'un yaml fies' itself.  No such luck.&lt;br /&gt;&lt;br /&gt;What tricks do you guys use when  you are serializing?  i'll take any help here.&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;Update 11-28-08&lt;/h2&gt;&lt;br /&gt;&lt;p&gt;As my exploits from &lt;a href="http://railsforum.com/viewtopic.php?id=24417"&gt;Railsforum&lt;/a&gt; will show, i got it to work finally.  Thanks to &lt;a href="http://thewebfellas.com/"&gt; rob-wtf from Railsforum&lt;/a&gt; for the help!&lt;/p&gt;&lt;p&gt;P.s.  I bookmarked their &lt;a href="http://thewebfellas.com/blog/2008/11/2/goodbye-attachment_fu-hello-paperclip"&gt;paperclip article...&lt;/a&gt; it's pretty good.  Well minus the windows stuff. &lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7033945969374781589-3362465844267425230?l=nerbie69.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nerbie69.blogspot.com/feeds/3362465844267425230/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nerbie69.blogspot.com/2008/11/serialize-what.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7033945969374781589/posts/default/3362465844267425230'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7033945969374781589/posts/default/3362465844267425230'/><link rel='alternate' type='text/html' href='http://nerbie69.blogspot.com/2008/11/serialize-what.html' title='Serialize... what the #@#&amp;%!!?'/><author><name>nerbie69</name><uri>http://www.blogger.com/profile/00829233647136943532</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7033945969374781589.post-8423559441352329883</id><published>2008-11-16T06:54:00.000-08:00</published><updated>2009-08-31T14:56:32.638-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='plugins'/><category scheme='http://www.blogger.com/atom/ns#' term='Merchant Accounts'/><category scheme='http://www.blogger.com/atom/ns#' term='active merchant'/><category scheme='http://www.blogger.com/atom/ns#' term='tutorials'/><title type='text'>Recurring Payments using PayPal Express and Active Merchant</title><content type='html'>&lt;p&gt;I needed a payment solution that took recurring payments for my rails app.  Most of the tutorials out there use either a US based merchant account provider, or are based in the UK.  I guess canadians are out to lunch.  Oh, and what's worse was that none of them really touched on subscription based models, or as it turns out, recurring payments.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Caveat: Now i am not here to take credit for what I'm about to write.  I only write this post as a 'mashup' of two great men and their tutorials on the subject.  I just took these two tutorials and used the good from both of them to come up with what you are about to read.&lt;/p&gt;&lt;br /&gt;&lt;h2&gt;The fine men who authored these posts&lt;/h2&gt;&lt;br /&gt;&lt;p&gt;&lt;b&gt;Cody Fauser - Active Merchant extraordinaire &lt;/b&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Cody is from all accounts the man, if not only the public face, of Active Merchant.  His &lt;a href="http://peepcode.com/products/activemerchant-pdf"&gt;Active Merchant Peepcode pdf&lt;/a&gt; (a must read and only 9 bucks!) is the go to guide for learning all about Active merchant from the man himself.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;b&gt;Jon Baker - Paypal Express Recurring Payments add on for Active Merchant Plugin &lt;/b&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;From his homepage"As well as leading the Rich internet Application at Trigger Software Ltd, he is CEO and Entrepreneur of &lt;a href="http://www.vibrantapps.com/"&gt;Vibrant Apps&lt;/a&gt; a small company based in Cornwall that makes useful and useable apps."&lt;/p&gt;&lt;br /&gt;&lt;h2&gt;On with the show...&lt;/h2&gt;&lt;br /&gt;&lt;p&gt;Basically, i used the framework from Cody's &lt;a href="http://www.codyfauser.com/2008/1/17/paypal-express-payments-with-activemerchant"&gt;Paypal Express Payments with Active Merchant&lt;/a&gt; for my controller/view actions and I used the plugin extension from Jon's post &lt;a href="http://clockobj.co.uk/2008/09/08/ruby-on-rails-paypal-express-recurring-payments-using-active-merchant/"&gt;Paypal Express Recurring Payments using Active Merchant&lt;/a&gt;.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;The sum of these two parts became what i needed to get a basic subscription for my app, and now for you too.&lt;/p&gt;&lt;br /&gt;&lt;h2&gt;Gimme the High Level overview nerbie69!&lt;/h2&gt;&lt;br /&gt;&lt;p&gt;Will do.  Oh, and i assume you already know how to create a rails app, and that you are following usual rails behaviour and will know that everything in here is based off of being inside your rails app, when you run any code.  This tutorial is probably above beginners so i assume anyone reading this kinda knows what they are doing and are just stuck at how to implement subscription based models easily.&lt;/p&gt;&lt;br /&gt;&lt;ol&gt;&lt;br /&gt; &lt;li&gt;Create your Paypal Sandbox developer account and instantiate an API credential from your seller account&lt;/li&gt;&lt;br /&gt; &lt;li&gt;Install Active Merchant from github&lt;/li&gt;&lt;br /&gt; &lt;li&gt;Insert Jon Baker's Paypal express Recurring Payments nv . rb file in your new Active Merchant plugin&lt;/li&gt;&lt;br /&gt; &lt;li&gt;Create your controller and views&lt;/li&gt;&lt;br /&gt; &lt;li&gt;Test your new subscription model in your browser&lt;/li&gt;&lt;br /&gt; &lt;li&gt;Pinch yourself... it was that easy.&lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&lt;br /&gt;&lt;p&gt;So there you have it.  It's the simple steps version of what you are about to do.&lt;/p&gt;&lt;br /&gt;&lt;h2&gt;Step One - Create  your paypal sandbox developer account&lt;/h2&gt;&lt;br /&gt;&lt;p&gt;Go to &lt;a href="https://developer.paypal.com"&gt;https://developer.paypal.com&lt;/a&gt; to set up your paypal developer account.  &lt;br /&gt;You can find better instructions on the developer site, but it isn't too hard and out of scope for this tutorial.  However, make sure you get the api credentials from the Seller account(_biz).  I.e., you must log in as the seller, in the sandbox, and follow Cody's instructions on how to set up the API.&lt;/p&gt;&lt;br /&gt;&lt;h2&gt;Step Two - Install Active Merchant&lt;/h2&gt;&lt;br /&gt;&lt;p&gt;Go to github and install the Active Merchant plugin: &lt;code&gt;script/plugin install git://github.com/Shopify/active_merchant.git&lt;/code&gt; I'm using the plugin here because it's easier to add a file, which is the next step.&lt;/p&gt;&lt;br /&gt;&lt;h2&gt;Step Three - Adding the paypal_express_recurring_nv.rb file to Active Merchant&lt;/h2&gt;&lt;br /&gt;&lt;p&gt;Download or copy and paste the following file &lt;a href"http://clockobj.co.uk/wp-content/uploads/2008/09/paypal_express_recurring_nv.rb"&gt;paypal_express_recurring_nv.rb&lt;/a&gt; and put it in the following directory: &lt;code&gt;/vendor/plugins/active_merchant/lib/active_merchant/billing/gateways/&lt;/code&gt;&lt;/p&gt;&lt;p&gt;The plan is to get this into active merchant in a future release.  We all have a part in making sure this happens, by emailing activemerchant's maintainers and saying how helpful this was.  Plus then we can fix any bugs and extend to make it even better.&lt;/p&gt;&lt;br /&gt;&lt;h2&gt;Step Four - Create your controller and views in your rails app&lt;/h2&gt;&lt;br /&gt;&lt;p&gt;From here on out is where i mashed the two tutorials together.  First create your controller and views: &lt;code&gt;script/generate controller subscriptions index confirm cancel error&lt;/code&gt;&lt;br /&gt; &lt;/p&gt;&lt;br /&gt;&lt;p&gt;Now add the following, as Cody says, to the top of your application.rb controller&lt;br /&gt;&lt;code&gt;include ActiveMerchant::Billing&lt;/code&gt;&lt;br /&gt;Also, don't forget to put your ActiveMerchant into test mode, as outlined in his tutorial.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;I'll paste the full controller code, so you can see it in all it's glory.  Notice, as Cody says, we didn't need a view for checkout, so that is why we didn't add 'it', to the generate code above.&lt;code&gt;class SubscriptionsController &lt; ApplicationController&lt;br /&gt;   def index&lt;br /&gt;   end&lt;br /&gt;&lt;br /&gt;   def cancel&lt;br /&gt;   end&lt;br /&gt;&lt;br /&gt;   def error&lt;br /&gt;&lt;br /&gt;   end&lt;br /&gt;&lt;br /&gt; # Confirmation step is the actual step that sends money.&lt;br /&gt;   def confirm&lt;br /&gt;     response = gateway.create_profile(999, params[:token], :reference =&gt; "34")&lt;br /&gt;     if !response.success?&lt;br /&gt;       @message = purchase.message&lt;br /&gt;       render :action =&gt; 'error'&lt;br /&gt;       return&lt;br /&gt;     end&lt;br /&gt;   end&lt;br /&gt; # The checkout method used to pass the values to paypal.  The description is shown to the user in their paypal account.&lt;br /&gt;   def checkout&lt;br /&gt;     setup_response = gateway.setup_agreement("Monthly subscription fee $9.99 USD",&lt;br /&gt;     :return_url        =&gt; url_for(:action =&gt; 'confirm', :only_path =&gt; false),&lt;br /&gt;     :cancel_return_url =&gt; url_for(:action =&gt; 'index', :only_path =&gt; false)&lt;br /&gt;     )&lt;br /&gt;     redirect_to gateway.redirect_url_for(setup_response.token)&lt;br /&gt;   end&lt;br /&gt;   private&lt;br /&gt;   #Here's the gateway info.&lt;br /&gt;   def gateway&lt;br /&gt;     @gateway ||= PaypalExpressRecurringNvGateway.new(&lt;br /&gt;       :login =&gt; 'Seller_232323455_biz_api1@site.com',&lt;br /&gt;       :password =&gt; 'W32RW53TE64Y7',&lt;br /&gt;       :signature =&gt; 'A90EWQRLSDA0SA.SAD0FASWEQ4ls0sl20S0SLD0.223.w'&lt;br /&gt;     )&lt;br /&gt;   end&lt;br /&gt; end&lt;br /&gt; &lt;/code&gt;&lt;/p&gt;&lt;br /&gt; &lt;h3&gt;Views&lt;/h3&gt;&lt;br /&gt; &lt;p&gt;The views are easy to setup and obviously could say anything.  Here is what i did, to get a generic subscription message setup:&lt;br /&gt; &lt;/p&gt;&lt;br /&gt; &lt;code&gt;# Index.html.erb:&lt;br /&gt;&lt;br /&gt;  &lt; h1 &gt;Site Subscription&lt; /h1&gt;&lt;br /&gt;  &lt; p &gt;Thank you for your decision to subscribe to this site.&lt;/p &gt;&lt;br /&gt;  &lt; p &gt;Your order total is $9.99 / month&lt;/p &gt;&lt;br /&gt;  &lt; p &gt;&lt;br /&gt;   &lt; % = link_to image_tag('https://www.paypal.com/en_US/i/btn/btn_xpressCheckout.gif'), :action =&gt; 'checkout' % &gt;&lt;br /&gt;  &lt; / p &gt;&lt;/code&gt;&lt;br /&gt;  &lt;p&gt;The error messages can stay the same as what cody has, i believe.&lt;/p&gt;&lt;br /&gt;  &lt;p&gt;The confirm view really doesn't have to say anything other then Thanks!  All the magic happens in the controller when the response comes back.  I know that i am probably going to add my own app specific controller functions to this confirm, such as creating their profiles and setting certain site variables, now that they have subscribed to become 'one of the cool kids'&lt;/p&gt;&lt;br /&gt;  &lt;h2&gt;Step Five - Test in your browser and revel at your genius&lt;/h2&gt;&lt;br /&gt;  &lt;p&gt;That heading says it all.&lt;/p&gt;&lt;br /&gt;  &lt;h2&gt;Thanks for reading and enjoy.&lt;/h2&gt;&lt;br /&gt;  &lt;p&gt;I hope that you enjoyed this little tutorial.  Subscription handling hasn't been easier thanks to Jon Baker, active merchant and all their hard work.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7033945969374781589-8423559441352329883?l=nerbie69.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nerbie69.blogspot.com/feeds/8423559441352329883/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nerbie69.blogspot.com/2008/11/recurring-payments-using-paypal-express.html#comment-form' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7033945969374781589/posts/default/8423559441352329883'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7033945969374781589/posts/default/8423559441352329883'/><link rel='alternate' type='text/html' href='http://nerbie69.blogspot.com/2008/11/recurring-payments-using-paypal-express.html' title='Recurring Payments using PayPal Express and Active Merchant'/><author><name>nerbie69</name><uri>http://www.blogger.com/profile/00829233647136943532</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7033945969374781589.post-7563961811867524004</id><published>2008-11-15T05:44:00.000-08:00</published><updated>2008-11-15T06:30:39.286-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='theory'/><category scheme='http://www.blogger.com/atom/ns#' term='admin'/><title type='text'>The tail of two admin panels</title><content type='html'>What are the most popular ways of handling an admin area in a web application?  Since i develop in rails, my focus will be on rails, however i do love the built in admin panel from django.  Excuse me DHH for I have sinned....&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:large;"&gt;&lt;span class="Apple-style-span" style="font-weight: bold;"&gt;Admin Concept #1 - separate namespace in url (i.e., /admin)&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;When adding an admin namespace, the following steps should be followed:&lt;/div&gt;&lt;div&gt;&lt;ol&gt;&lt;li&gt;change routes&lt;br /&gt;&lt;/li&gt;&lt;li&gt;setup new directory structure in app/&lt;br /&gt;&lt;/li&gt;&lt;li&gt;change views to reflect new namespace&lt;br /&gt;&lt;/li&gt;&lt;li&gt;secure access to the new admin namespace&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;&lt;div&gt;1. Change your routes to reflect the new namespace.  for instance:&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt; map.namespace :admin do |admin|&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;    admin.resources :posts&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;    admin.resources :categories&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;    admin.resources :forums&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;    admin.resources :products&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;  end&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;Just for fun, run rake routes in  your app, and look at all of your new lovely routes!&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;2. Include a new admin directory under your app/controller, app/views and app/helpers.  E.g.,&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt; app/controller/admin/nameofcontroller.rb&lt;/span&gt;.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;You will need to change the first line of your code to read:&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt; class Admin::YourCont&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: 'courier new';"&gt;roller &lt; ApplicationController&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'courier new';"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;Any redirects in your controller code must be changed to reflect your new namespace.  simply replace your existing @variable with  &lt;span class="Apple-style-span" style="font-family: 'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;[:admin, @your_variable] &lt;span class="Apple-style-span" style="font-family: georgia;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;in the redirect&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;. &lt;/span&gt; This code will redirect to the proper show method.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;3.  For any new or edit views, you need to change your form_for to reflect your new namespace as well.  Changing the &lt;span class="Apple-style-span" style="font-family: 'courier new';"&gt;@variable&lt;/span&gt; again to reflect the new &lt;span class="Apple-style-span" style="font-family: 'courier new';"&gt;[:admin, @variable] &lt;/span&gt;should do the trick in most cases.  &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Also, your routes have changed, so you will need to change your restful routes in all of your new admin/model views.  Usually you only need to add "admin_" to the existing route.  e.g., &lt;span class="Apple-style-span" style="font-family: 'courier new';"&gt;posts_path&lt;/span&gt; would become &lt;span class="Apple-style-span" style="font-family: 'courier new';"&gt;admin_posts_path&lt;/span&gt;.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: large;"&gt;&lt;span class="Apple-style-span" style="font-weight: bold;"&gt;Concept #2 - inline administration.  &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Allows users to administer their site based on their user Id.  If the user is set to admin in the database, then more options appear on their profile.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;That user would then have access to /settings, for instance, because of their admin status.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The Settings model would be set up as usual, i.e., no namespace needed, but a before_filter would be used to allow access only to that admin user.  &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-weight: bold;"&gt;Question:  Is there a third concept?&lt;/span&gt;  What other ways can be used to allow for an admin "area"? Please post your comments, as I would love to hear your thoughts.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7033945969374781589-7563961811867524004?l=nerbie69.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://nerbie69.blogspot.com/feeds/7563961811867524004/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://nerbie69.blogspot.com/2008/11/tail-of-two-admin-panels.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7033945969374781589/posts/default/7563961811867524004'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7033945969374781589/posts/default/7563961811867524004'/><link rel='alternate' type='text/html' href='http://nerbie69.blogspot.com/2008/11/tail-of-two-admin-panels.html' title='The tail of two admin panels'/><author><name>nerbie69</name><uri>http://www.blogger.com/profile/00829233647136943532</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry></feed>
