Rails 2.0.1 Todo List tutorial

I’ve been meaning to try Rails 2.0.1, and I had some trouble finding an example. I did find this one, which is quite good.

I thought I would add one of my own. Here in five lines are the steps to create a basic todo list application in rails.

rails todo
cd todo
rake db:create:all
script/generate scaffold Todo title:string body:text done:boolean due:datetime
rake db:migrate

Then start the web server
script/server

Open your browser to http://localhost:3000/todos

You can now create, edit and Delete items. Wow. Not one SQL command.

This tutorial assumes the following:
ralis 2.0.1 installed
running mysql with no password for root at localhost.
(And it was also made on a Macbook OS X Leopard).

9 Comments »

  1. Top Secret Project » Blog Archive » Why Rails is better than whatever it is you use: ToDo List in 5 Lines said,

    December 18, 2007 @ 6:10 pm

    […] Rob Mayhew prepared this ToDo List Tutorial […]

  2. Paul Kavanagh said,

    December 24, 2007 @ 1:14 pm

    That is just the ticket! I have been struggling to make a site because of the changes in scaffold and routing, and this example got me through it.

  3. keith murphy said,

    December 25, 2007 @ 10:09 am

    great example! it’s nice to start with the basics and work your way up to the more complicated examples. a great “Hello, world” example. Thanks for putting this up.

  4. Spencer said,

    December 30, 2007 @ 6:52 pm

    Killer! Thanks!

  5. Roger Gordon said,

    January 13, 2008 @ 7:07 am

    Thanks very much for this. I thought I’d never get Ruby working until this app. I can’t believe how quick and easy that was!

  6. Jason said,

    March 16, 2008 @ 12:25 pm

    Nice and thank you. I used the following to to get this up and running with sqlite3:
    rails -d sqlite3 todo
    cd todo
    rake db:create:all
    script/generate scaffold Todo title:string body:text done:boolean due:datetime
    rake db:migrate
    script/server

  7. noah said,

    March 20, 2008 @ 6:49 am

    um…. yeah, thanks Rob. I really don’t know what to say its just pretty.

  8. Ruby on Rails Tutorials (version 2.0+ compatible) said,

    April 8, 2008 @ 3:29 pm

    […] Excellent 1 paragraph tutorial on how to get started by Rob Mayhew These icons link to social bookmarking sites where readers can share and discover new web pages. […]

  9. Ruby on Rails Tutorials (version 2.0+ compatible) said,

    June 19, 2008 @ 8:07 pm

    […] Excellent 1 paragraph tutorial on how to get started by Rob Mayhew […]

RSS feed for comments on this post · TrackBack URI

Leave a Comment