NoobOnRails

Ruby on Rails tips, tricks and hints for the aspiring rails hero.



Wednesday, June 21, 2006

Coming soon: the things you can do with the acts_as_taggable plugin


I saw that some more changes have been made to the acts_as_taggable plugin so I figured I give everyone a head's up that I'll be putting up a how to post within the next few days...

Tuesday, June 20, 2006

How to setup Mongrel as a native Window's service


Being that I have to do my Ruby on Rails development in a Windows environment, I jumped at the chance to use the impressive, somewhat-new, lil web server that could Mongrel. I thought it was pretty cool that you could run it as a Windows service. "mongrel_rails start" is just way too much for me to type...seriously, it's like I type "mongrel_rai...what was I doing again?". Adult ADD is real and here to stay people. All semi-kidding aside, here's how to go from zero to mongrel hero in as fast as it takes you to type these next steps:

1. From a command prompt type in

"gem install mongrel" and hit enter...



...you'll get a whole slew of versions to install and that's normal. Right now, 3.13 for mswin32 is out and that should be #1 so pick that one.

2. After mongrel is installed, test it to make sure you're good to go. "cd" into your application's directory and type in "mongrel_rails start" to make sure Mongrel boots up as it should...



3. If it looks all good and sorted, you'll need to install the win32-service gem, via "gem install win32-service" (pick the most recent one...)



4. Sweet, now install the mongrel_service gem...i'm sure you know the drill by now, it's

gem install mongrel_service

(no screenshots for this step because i'm lazy)

5. Now for the good stuff, actually creating the service...

"mongrel_rails service::install -N MyAppsServiceName -c c:\app\myapp -p 4000 -e production"

I'm sure you can guess the params, but for the sake of completeness I'll go through what they mean. The-N MyAppsServiceName is what the service will be called, -p is the port number it'll run through (you'll probably want to change it if you have multiple apps on your box) and -e is the "mode" you want your app to run in.



6. Bam! Now you should be good to go...

A neat little feature of Ror 1.1+ I've noticed


If you're really new to rails you may have thought this was normal but with myself being a Railer pre version 1.0, it took me a while to see that Rails was doing this on purpose. What is "this" you ask? The fact that now when you script generate a new model, a new migration file for the new model also gets created.



That's dang spiffy if you ask me but if did give me some brief grief (ha!) since I had alreay added "creat_tables" in my base migration file for these models. Now I know to just go with the Rails flow. More "convention over configuration" is always good to me.

Monday, June 19, 2006

Last Windows Railer


I must be one of the last Railers doing development only on Windows (not by choice but by $$$)...for now at least...

Rails Day sites


Rails day bought out some nice looking sites from some well known Railers. None from me (a whole Rails app in a day!?!?! I have three kids, and a wife!) but hey, there's always next year. Some noteable sites being a ticket tracker dubbed Advisr from Team Awsome, the Inductor from Concenration Studios, SimpleForms from Simplistic Complexity, WeRateStuff from WeBreakStuff and that's about all the clicking I felt like doing. You can view the other teams here. I would have to give the best name prize to team WWDHHD. That has to stand for What Would David Heinemeier Hansson Do...awsome, I don't know what he'd do but I cant' wait to see what this team came up with!

Good stuff all round.


p.s. especially from mr. hasmanythrough himself...