4 Comments »

Agenda

  • Application: LinkWizz, similar to http://del.icio.us
  • Make an app with simple tools (MySQL command line, text editor).
  • Not showing scaffolding at this point.
  • Will not create database the Rails way (using migrations), but with ordinary SQL statements.
  • Will be showing layouts. It’s a little complicated at this point, but important.
  • Will add additional screencasts later to show other features of Rails.
  • Sequence:
    • rails command to create project;
    • start up server;
    • look at directory structure;
    • browse to app (http://localhost:3000)
    • generate Link controller, and define list method and list.rhtml view
    • Create database and “links” table
    • Edit config/database.yml
    • Generate Link model (notice: database table is plural “links” but model name is singular “Link”)
    • Add code to list.rhtml view to display links
    • Add to Link controller add method and add.rhtml view
    • Add code to add.rhtml for the form
    • Add a save method to the Link controller
    • Setup layout and stylesheets
    • Add code to display the flash

View (you will want to maximize your browser; to go “full-screen” in Firefox, press F11; then to turn off full-screen, press F11 again)

And the code is here.