Category "Coding"

November 3, 2007

Rails: Click!

So I'm geeking out with Ruby on Rails lately. It's a dream come true. Working on my ongoing PHP projects just about breaks my heart, and I almost want to go to clients and convince them to start projects over because really, I'll probably have them done faster that way anyway.

And then last night I was staring at my project-mainly-for-the-sake-of-getting-my-hands-dirty-in RoR, that I'd been smashing my fists on the keyboard with for about a week... and suddenly it clicked. I got it. Suddenly I saw how some of the pieces fit together... and I (just as a tentative am-I-really-seeing-what-I-think-I'm-seeing test you understand) started a new rails app and in just a few minutes had that new test app up to almost exactly the same point as the one I'd been struggling so hard with!

So here they are, then 10-12 (depending on how you look at it) steps of how I basically plan to start every forseeable rails app I work on in the near future. Two assumptions here, (1) I pretty much always want to use database sessions as opposed to flat file sessions, and (2) almost every single web app on the face of the interwebs requires a login and password. So, mostly general concise instructions for those with some rails knowledge; commands in the terminal are preceded by [term]:

  1. [term] rails my_app
  2. create database
  3. add password to database.yml
  4. uncomment db sessions in environment.rb
  5. [term] rake db:sessions:create
  6. [term] script/plugin source HTTP://
  7. [term] script/plugin install acts_as_authenticated
  8. [term] script/generate authenticated user account
  9. generate models
  10. edit table creation migrations
  11. [term] rake db:migrate
  12. generate scaffolds

Posted by crock038 at 12:07 PM | Comments (0) | Coding