Sunday, May 3, 2009

My RailsSpace Journey - Day 2

  1. May 2nd: Read the first 33 pages of RailsSpace.
  2. Book URL on page 5.
  3. NOTE THAT ALL PAGE NUMBERS ARE FROM RailsSpace Book unless otherwise.
  4. Ran "rails.bat ralis_space" on my Vista/PC and it created the project under my RAILSPASSION directory. (pg.16)
  5. Ran "cd rails_space ; ruby script/server" and got this. (pg.18) : => Booting Mongrel
    => Rails 2.3.2 application starting on
    => Call with -d to detach
    => Ctrl-C to shutdown server
  6. I checked "localhost:3000" and got default screen as seen on page 19.
  7. Then I did this: $ ruby script/generate controller site index about help and got this: (p.21)
    exists app/controllers/
    exists app/helpers/
    create app/views/site
    exists test/functional/
    create test/unit/helpers/
    create app/controllers/site_controller.rb
    create test/functional/site_controller_test.rb
    create app/helpers/site_helper.rb
    create test/unit/helpers/site_helper_test.rb
    create app/views/site/index.html.erb
    create app/views/site/about.html.erb
    create app/views/site/help.html.erb
  8. Then I did this: "gem rdoc --all" - Got a few, then errored out. (p.24)
  9. Edited routes.rb as specificed on page 26. Deleted Public/index.html and edited views/site/index.rhtml as specificed on page 26. Then refreshed web page and got the screen as shown on top of page 27.
  10. Then i edited aobut.rhtml and help.rhtml as specified on page 28. Then created site.rhtml as specified on page 29.
  11. Then I edited/shortened index.rhtml on bottom of page 29. Refresh web page and saw that it worked. Also shorten about.rhtml and help.rhtml web pages on specified on page 30.
  12. Set up Netbeans for RailsSpace and moved 1st 11 steps of data under Netbeans directiory. After a few bumps, it worked as seen (the web page) on bottom of page 33.
  13. Then I modified (removed extra curly braces/paras) site.rhtml as specificed on page 36 and refreshed web page. It worked.
  14. Then changed all "link_to" to "link_to_unless_current" as specified on page 37.
  15. Downloaded the RailsSpace files zip file from publisher and used "site.css" as specified on page 40. Restarted webserver and check all 3 web pages. They worked as seen on page 41.
  16. End of Chapter 2
  18. Used netbeans to create:db (pg.43-45).
  19. Used netbeans to generate model for User (p.47).
  20. Then add 3 columns (screen_name, email, password) to migration file (p.48).
  21. Used netbeans to run db:migrate. (p.49)
  22. Enter one user using netbean's console. (p.52-53)
  23. Then added 5 validations to user model. (p.54)
  24. Then added constants to user model as specified on page 55-56.
  25. Then added validate method as specified on page 57.
  26. Then added "if" statemend as specified on top of page 58.
  27. Then added "full-strength" validations as specified on page 59.
  28. I skipped page 62 where it wanted me to add create_at and update_at since netbeans or rails already added them. (p.62)
  29. Finished Chapter 3.
  30. Chapter 4: Generated another controller, "user", with index and register views. (p.66)
  31. Then edited user_controller.rb as specified at bottom of page 67.
  32. Then copied site.rhtml into brand new application.rhtml view. (p.68)
  33. Then undid step 30. (smile) (p.g68).
  34. Then edited register.rhtml to add CSS. (p.68-69)
  35. Then edited site.css file as specified on page 69.
  36. WEB PAGE DISPLAY IS BROKEN (p.66,68,71,76) (get: Routing Error ;
    No route matches "/user" with {:method=>:get}) UNCLEAR IF I SHOULD BE ABLE TO DISPLAY WEB PAGE.\
  37. Fix step 36 by restarting the server.
  38. Then edited user.rb model as specified on bottom of page 73.
  39. Then edited register.rb as specified on page 74.
  40. Then added debug lines to application.rhtml and site.css as on page 75-76.
  41. Then add processing code to user_controller as on page 78.
  42. Then edited register.rb as specified on page 84.
  43. Then edited site.css file as specified on page 85.
  44. Then edited applicaton.rhtml as specified on page 86.
  45. Then edited site.css file as specified on page 87.
  46. Then edited application.rhtml as specified on bottom of page 87.
  47. Then edited user_controller.rb as specified on page 88.
  48. Then edited index.rhtml view and user_controller.rb controller as specified on page 89.
  49. Then edited application.rhtml layout as specified on page 90-91.
  50. Then edited application.rhtml layout as specified on page 91.
  51. Then edited the application_helper.rb file as specified on page 92 and page 93.
  52. Then edited the application.rhtml layout file as specified on page 93.
  53. Finally for chapter 4, I dropped the tables and recreated the tables as specified on page 95 and then entered one user as specified on page 95. AND IT WORKED.
  54. End of Chapter 4. Testing next.

No comments:

Post a Comment