Showing posts with label Rails Passion Course. Show all posts
Showing posts with label Rails Passion Course. Show all posts

Wednesday, June 3, 2009

Week 21 "Optional 6": Rails Passion Course

  1. Rails Example Application - TimeTracker Application (Week 21/Option 6)
  2. Presentation:PDF: 1 slide per page (OR)OpenOffice file: None
  3. Homework: None
  4. Resources
    o Ruby Time Tracker homesite from code.google.com/rubytime
  5. 5547_rails_timetracker_app.zip (Unzip it in a directory of your choice and read lab document from /rails_timetracker_app/index.html to proceed) (6/3/2009: Downloaded)
o Online lab document/Change Log (This is the same document you will find in the hands-on lab zip file)

Week 21 "Optional 5": Rails Passion Course

  1. Rails Example Application - FreeMIS Application (Week 21/Optional 5)
  2. Presentation:PDF: 1 slide per page (OR) OpenOffice file: None
  3. Resources
    o FreeMIS homesite from www.freemis.net
  4. Homework: None
  5. 5546_rails_freemis_app.zip (Unzip it in a directory of your choice and read lab document from /rails_freemis_app/index.html to proceed) (6/3/09: Downloaded)
  6. Online lab document/Change Log (This is the same document you will find in the hands-on lab zip file) (6/3/2009: Had problems so deferred)

Week 21 "Optional 4": Rails Passion Course

  1. Rails Example Application - Substruct Application (ECommerce Application) (Week 21/Optional 4)
  2. Presentation - there is no presentation.
  3. Resources
    o Substruct homesite
    o Installing Substruct blog
  4. Homework: 6/3/2009: Checked/None Yet.
  5. 5542_rails_substruct_app.zip (Unzip it in a directory of your choice and read lab document from /rails_substruct_app/index.html to proceed) (6/3/2009: Downloaded)
  6. Online lab document/Change Log (This is the same document you will find in the hands-on lab zip file) (6/3/2009: Started)
  7. Had problems so deferred.

Week 21 "Optional 3": Rails Passion Course

  1. Rails Example Application - Typo Application (Week 21/Optional 3)
  2. Presentation - there is no presentation
  3. Homework - tbd (None yet)
  4. Resources
    o typo homesite from www.typosphere.org
  5. 5543_rails_typo_app.zip (Unzip it in a directory of your choice and read lab document from /rails_typo_app/index.html to proceed) (6/3/09: Downloaded)
o Online lab document/Change Log (This is the same document you will find in the hands-on lab zip file)

Week 21 "Optionals/Empties": Rails Passion Course

  1. Ruby Gems (Week 21/Optional 1)
  2. Presentation: PDF: 1 slide per page (OR) OpenOffice file: None
  3. Download: None
  4. Lab/Change Log: None
  5. Resources
    o RubyGems Manual from rubygems.org
  6. Rails Security (Week 21/Optional 2)
  7. Presentation: PDF: 1 slide per page (OR) OpenOffice file: None
  8. Download: None
  9. Lab/Change Log: None
  10. Resources
    o Ruby on Rails Security Guide document from www.quarkruby.com
  11. Caching (Week 21/Optional 7)
  12. Link goes back to TOC, so done.
  13. Performance (Week 21/Optional 8)
  14. Download: None
  15. Presentation: PDF: 1 slide per page (OR) OpenOffice file: None
  16. Lab/Change Log: None
  17. Resources: None
  18. Action Mailer (Week 21/Optional 9)
  19. Presentation: PDF: 1 slide per page (OR) OpenOffice file: None
  20. Download: None
  21. Lab/Change Log: None
  22. Resources: Action Mailer from api.rubyonrails.org
  23. Rails and Other Web Technologies (Week 21/Optional 10)
  24. Presentation: PDF: 1 slide per page (OR) OpenOffice file: None
  25. Download: None
  26. Lab/Change Log: None
  27. Resources: jMaki on Rails blog by Arun Gupta (March, 2008)
  28. Plug-in (Week 21/Optional 11)
  29. Presentation: PDF: 1 slide per page (OR) OpenOffice file: None
  30. Download: None
  31. Lab/Change Log: None
  32. Resources: None
  33. Misc Topics (Week 21/Optional 12)
  34. Presentation: PDF: 1 slide per page (OR) OpenOffice file: None
  35. Download: None
  36. Lab/Change Log: None
  37. Resources

Week 20: Rails Passion Course

  1. Rails Example Application - Redmine Application (Week 20)
  2. Presentation - there is no presentation
  3. 5539_rails_redmine_app.zip (Unzip it in a directory of your choice and read lab document from /rails_redmine_app/index.html to proceed) (6/3/2009: Downloaded)
  4. Homework: "TBD" (Nothing Yet)
  5. Resources
    o Redmine homesite
    o Redmine sample application from www.redmine.org
  6. Online lab document/Change Log (This is the same document you will find in the hands-on lab zip file) (6/3/09: Successfully finished the Lab, therefore finished with HW20)

Tuesday, June 2, 2009

Week 19: Rails Passion Course

  1. Rails Example Application - Flickr Application (Week 19)
  2. Presentation - there is no presentation.
  3. Resources - there is no resources.
  4. Homework - There is no Homework this week/unit.
  5. 5541_rails_flickr_app.zip (Unzip it in a directory of your choice and read lab document from /rails_flickr_app/index.html to proceed) (6/2/09: Downloaded)
  6. Online lab document/ Change Log (This is the same document you will find in the hands-on lab zip file) (6/6/2009: Started over)
  7. (1.1) Already had Flicker API Key, so skipped this step. (p.2-3)
  8. (1.2) Checked and already had Flickr gem (1.0.2), so skipped this step. (p.3-8).
  9. (1.3) Created brand new rails project (flickr0606). (p.8-12)
  10. (1.4) Create brand new database, flickr0606_development. Also moved project under RAILSPASSION directory. (p.12-14)
  11. (1.5) Add Flickr settings to project's environment.rb file. Also added my pass key. (p.14-17)
  12. (1.6) Define a layout and stylesheet. I created a new layout file, application.rhtml. NOTE THAT NETBEANS FOUND A ERROR IN THE SUPPLIED FILE. Unclear how to fix it. Also created a brand new CSS file, flickr.css. (p.17-23)
  13. (1.7) Create a controller, flickr, but only after removing the two "require" statements in the config/environment.rb file. Also added supplied search method to flickr controller. (p.25-30)
  14. (1.8) Modified index.html.erb with supplied text, but Netbeans found 2 errors - unclear how to fix them. Then created brand new Partial, _photo, file, but Netbeans found 1 error - unclear how to fix it. (p.30-35)
  15. (1.9) Set URL routing: Modify routes.rb and renaming index.html. (p.35-38)
  16. (1.10) Ran the application and got the web page, but when I typed in "Netbeans and select "Find" I got "ArgumentError in FlickrController#search;
    wrong # of arguments(3 for 0)" (p.38-41)
  17. Watched: http://media.rubyonrails.org/video/flickr-rails-ajax.mov
  18. Found this: http://snippets.dzone.com/posts/show/3493
  19. Also Found this: http://weblogs.java.net/blog/bleonard/archive/2007/03/building_a_ruby.html
  20. Finally got it to run by running it from the command line. (p.41)
  21. (1.11) Copied spinner.gif to public/images directory. Also modified index.rhtml.erb file with supplied text. (p.41-44)
  22. Run it again. (6/6/2009: It worked so I packaged it up and emailed my last homework/lesson)





Sunday, May 31, 2009

Week 18: Rails Passion Course

  1. Rails Example Application -Depot Application (Week 18)
  2. 5536_rails_depot_app.zip (Unzip it in a directory of your choice and read lab document from /rails_depot_app/index.html to proceed) (5/31/09: Downloaded)
  3. Presentation - there is no presentation
  4. Resources
    o Rails code examples site
    + Ruby on Rails Open Source Projects website from wiki.rubyonrails.com
    + Top 29 Ruby on Rails Demos Example Code Samples
    + Dzone Snippets rubyonrails
    o Examples
    + Top 12 Ruby on Rails Tutorials from digitialmediaminute.com
    + Rails Petstore email

o Online lab document/ Change Log (This is the same document you will find in the hands-on lab zip file) (66 pages)
o Homework (Yes, We have Homework)

Week 17: Rails Passion Course

  1. Deployment (Week 17) (Topics covered: Deployment)
  2. 5538_rails_deploy.zip (Unzip it in a directory of your choice and read lab document from /rails_deploy/index.html to proceed)
  3. Resources: Deploying on GlassFish
    + GlassFish v2 and JRuby powering WorldcChange Comm (April 2008)
    + JRuby-on-Rails standalone and shared WARs in Glassfish screencast by Arun Gupta (Oct. 2007)
    + JRuby on Rails Rewrite of mediacast.sun.com launched (Jan. 2008)
    + Deploying JRuby applications with Java Web start article from infoq.com (March, 2008)
    + Rails and Java EE integration - Servlet co-bindled and invoked from Rails blog by Arun Gupta (April, 2008)
    + Rails and Java EE integration - Native Rails on GlassFish v3 blog by Arun Gupta (April 2008)
    o Warbler
    + Rails and Java EE integration - Warbler instead of Goldspike blog by Arun Gupta (April, 2008)
    + Wabler, A Little Birdie To Introduce Your Rails App to Java blog by Nick Sieger (Sep. 2007)
    + Warbler documentation from caldersphere.rubyforge.org
    o Goldspike
    + Goldspike homesite
    o JDBC
    + JDBC Connection Pooling for Rails on GlassFish blog by lkai Lan (Aug. 2008)
    o Presentations
    + Enterprise Ruby with JRuby on Rails presentation by Naoto Takai
  4. Presentation: PDF: 1 slide per page (OR) OpenOffice file (5 pages) (5/31/09: Read)
  5. Online lab/Change Log document (This is the same document you will find in the hands-on lab zip file) (5/31/09: Did most of it/No Glassfish/Had problems with Glassfish)
  6. 5/31/09: No Homework

Week 16: Rails Passion Course

  1. Ajax (Week 16) (Topics covered: Ajax/JavaScript libraries in Rails, PrototypeHelper, ScriptaculousHelper, JavaScriptMacrosHelper, JavaScript related utility methods, Ruby JavaScript template)
  2. 5532_rails_ajax.zip (Unzip it in a directory of your choice and read lab document from /rails_ajax/index.html to proceed) (5/31/09: Downloaded)
  3. Resources
    o ActionView::Helpers::PrototypeHelper API from api.rubyonrails.org
    o ActionView::Helpers::ScriptaculousHelper API from api.rubyonrails.org
    o ActionView::Helpers::JavaScriptHelper API from api.rubyonrails.org
    o ActionView::Helpers::JavaScriptMacrosHelper from api.rubyonrails.org
    o Using Ajax With Ruby on Rails tutorial by Brian Leonard and Natalie Jeremy
    o jMaki on Rails blog by Arun Gupta (March, 2008)
  4. Homework ("To Be Provided") (5/31/09: None Yet)
  5. Presentation: PDF: 1 slide per page (OR) OpenOffice file (56 pages) (5/31/09: Scanned)
  6. Online lab/Change Log document (This is the same document you will find in the hands-on lab zip file) (28 pages) (5/31/09: Read/No Homework)

Monday, May 25, 2009

Week 15: Rails Passion Course

  1. Testing & RSpec (Week 15) (Topics to be covered: Overview of Rails testing, Unit testing, Functional testing, Integration testing)
  2. 5535_rails_testing.zip (Unzip it in a directory of your choice and read lab document from /rails_testing/index.html to proceed) (5/25/09: Downloaded)
  3. Resources
    o Tutorials
    + About "A Guide to Testing the Rails" article from manuals.rubyonrails.com
    + Developing a Rails model using BDD + RSpec tutorial by Luke Redpath (8/06)
    o NetBeans tutorials
    + Ruby Testing NetBeans tutorial from wiki.netbeans.org
    + Screencast: RSpec and NetBeans by Nick Sieger (Feb. 2008)
    + Test-Driven Rails Development tutorial by Brian Leonard and Neth Stearns from netbeans.org (Dec. 2007)
    + Graphic guide to Rails on NetBeans: RSpec and Autotest from scratch tutorial (Nov. 2007)
    o References
    + Assert methods from ruby-doc.org
  4. Presentation: PDF: 1 slide per page OR OpenOffice file (28 pages) (5/25/09: Read)
o Online lab document/Change Log (This is the same document you will find in the hands-on lab zip file)
o Homework (5/31/09: Finally finished it)

Week 14: Rails Passion Course

  1. REST Support (Week 14) (Topics to be covered: What is REST?, REST support in Rails, Format of the response via response_to)
  2. 5534_rails_rest.zip (Unzip it in a directory of your choice and read lab document from /rails_rest/index.html to proceed) (5/25/09: Downloaded)
  3. Resources
    o Tutorials
    + Designing RESTful Rails Applications screencast by Obie Fernandez from infoq.com (July, 2008)
    + Web Services, Rails-style blog by Jamis
    + Rails 1.2: REST admiration, HTTP lovefest, and UTF-8 celebrations article (Jan. 2007)
    + Rapid RESTful Rails Apps article by Myles Eftos (Feb. 2008)
    + Introduction to AWS (Amazon Web Services) for Ruby Developers from developer.amazon.com
    o API
    + ActionController::Resources from api.rubyonrails.org
    o Client
    + Ruby REST client
  4. Online lab document/Change Log (This is the same document you will find in the hands-on lab zip file) (5/25/09: done)
  5. Presentation: PDF: 1 slide per page OR OpenOffice file (24 pages) (5/25/09: Read)
  6. Homework 14 (5/25/09: Done/Emailed to Sun)

Sunday, May 24, 2009

Week 13: Rails Passion Course

  1. Action View Helpers (Week 13) (Topics to be covered: Types of ActionView Helpers, FormHelper's, FormTagHelper's)
  2. 5533_rails_viewhelpers.zip (Unzip it in a directory of your choice and read lab document from /rails_viewhelpers/index.html to proceed) (5/24/09: Downloaded)
  3. Resources
    o ActionView::Helpers::FormHelper API from api.rubyonrails.org
    o ActionView::Helpers::FormTagHelper API from api.rubyonrails.org
  4. Lab and homework/Change Log (1 page) (5/24/09: Read)
  5. Online lab/Change Log document (This is the same document you will find in the hands-on lab zip file) (5/24/09: Read)
  6. Presentation:PDF: 1 slide per page OR OpenOffice file (23 pages) (5/24/09: Read)
  7. Pre-class reading material (Action view helper tutorial) (11 pages) (5/24/09: Read)
  8. Monday: Starting HW13.
  9. Started up Netbeans, build databases, and migrated the database.
  10. Added "Gender" field to Student table.
  11. Homework 13 (5/25/09: Emailed)

Week 12: Rails Passion Course

  1. Action View Basics (Week 12) (Topics to be covered: Types of templates, ERb template, Builder template, JavaScriptGenerator template, Using sub-templates, Layouts, Partials)
  2. 5531_rails_actionview.zip (Unzip it in a directory of your choice and read lab document from /rails_actionview/index.html to proceed) (5/24/09: Downloaded)
  3. Resources
    o ActionView::Base API from api.rubyonrails.org
    o ActionView::Partials API from railsbrain.com
  4. Pre-class reading material (Action view tutorial) (5/24/09: Scanned it)
  5. Presentation: PDF: 1 slide per page OR OpenOffice file (29 pages) (5/24/09: Read)
  6. Online lab document/Change Log (This is the same document you will find in the hands-on lab zip file) (5/24/09: Done)
  7. Homework (Combine the 2 partials into one file and use it in edit and new .html.erb files) (5/24/09: Created draft)

Friday, April 24, 2009

Week 11: Rails Passion Course

  1. Week 11: Action Controller Basics (Action Controllers are the core of a web request in Rails. They are made up of one or more actions that are executed on request and then either render a template or redirect to another action. An action is defined as a public method on the controller, which will automatically be made accessible to the web-server through Rails Routes.
    Topics to be covered: What is ActionController?, ActionController classes, Request handling, Parameters, Session & Flash, Rendering, Redirection, Classic problem of user refresh & redirection, Routing (request mapping))
  2. 5526_rails_controller.zip (Unzip it in a directory of your choice and read lab document from /rails_controller/index.html to proceed) (4/24/09: Downloaded)
  3. Week 11 Resources
    o Basics
    + Action Pack from api.rubyonrails.org
    + ActionController::Base API from api.rubyonrails.org
    + ActionController::Flash API from api.rubyonrails.org
    o Routing
    + ActionController::Routing API from api.rubyonrails.org
    o Caching
    + ActionController::Caching API from api.rubyonrails.org
  4. Presentation - PDF: 1 slide per page (OR) OpenOffice file (47 pages) (4/27/2009: Done)
  5. Online Lab document/Change Log (This is the same document you will find in the hands-on lab zip file) (93 pages)
  6. EXERCISE 0: Start MySQL database server. (p.2)
  7. EXERCISE 1: Requests and Parameters I (p.2-15)
  8. (1.0) Open and run "helloworld" sample application (p.2-4)
  9. (1.1) Observe parameters in development log. (p.4-6)
  10. (1.2) Modify the controller (p.6-9)
  11. (1.3) Pass the parameters through URL (p.9-11)
  12. (1.4) Observe the parameters in development log (p.11-12)
  13. (1.5) Observe the controller and action parameters (p.12-16) PROBLEM: :action not displayed. The fix was to rename ":action_name" to ":action1_name"
  14. EXERCISE 2: Request and Parameters II (p.16-34)
  15. (2.0) Open and run "helloname" sample application project. (p.16-19)
  16. (2.1)Observe parameters in development log. (p.19-22)
  17. (2.2) Study how user input data is collected as parameters (p.22-25)
  18. (2.3) Study how parameters are accessed in the controller (p.25-26)
  19. (2.4) Add another column to the table through migration (p.26-30)
  20. (2.5) Modify the code of index.html.erb and respond.html.erb files. (p.30-31)
  21. (2.6) Run the helloname application. (p.31-33)
  22. (2.7) Observe the parameters in development log. (p.33-34)
  23. EXERCISE 3: Session and Flash (p.34-63)
  24. (3.1) Use session. (p.34-40)
  25. (3.2) Use ActiveRecordStore to maintain session data (p.40-56)
  26. (3.3) Use Flash (p.56-63)
  27. EXERCISE 4: Rendering (p.63-72)
  28. (4.1) Use render :text (p.64-66)
  29. (4.2) Use render :action => :respond (p.66-68)
  30. (4.3) Use render :action => 'respond" (p.68-70)
  31. (4.4) Use render :template (p.70-72)
  32. EXERCISE #5: User refresh problem with "render" - Use "redirect_to" (p.72-87)
  33. (5.1) Observe the problem of using render :action=>'list' when a user press "Refresh" (p.73-80)
  34. (5.2) Correct the problem by using redirect :action=>'list' instead (p.80-87)
  35. EXERCISE #6: Routing Basics (p.87-
  36. (6.1) Use Rails Console (for routing experimentation) (p.87-88)
  37. (6.2) Named routes (p.88-92)
  38. Homework


Tuesday, April 21, 2009

Week 10: Rails Passion Course

  1. Week 10: ActiveRecord Associations Basics (Topics covered: What is an Association?, Auto-generated methods, Cardinality, Unsaved objects and association)
  2. Week 10 Resources
    o ActiveRecord::Associations:ClassMethods API from api.rubyonrails.org
    o Building Relationships Between Rails Models tutorial by Brian Leonard and Gail Chappell
  3. 5525_rails_associations.zip (Unzip it in a directory of your choice and read lab document from /rails_associations/index.html to proceed) (4/21/09: Downloaded)
  4. Presentation - PDF: 1 slide per page (OR) OpenOffice file (22 pages)
  5. Online Lab/Change Log document (This is the same document you will find in the hands-on lab zip file) (84 pages)
  6. EXERCISE #0: Start MySQL database server (p.g2) (4/21/2009: done)
  7. EXERCISE #1: Add one-to-many association to rubyweblog application. (p.2-28)
  8. (1.1) Create Comment Model class (p.3-6)
  9. (1.2) Migrate database (p.6-7)
  10. (1.3) Add association macros to the Model classes (p.8-11)
  11. (1.4) Modify controller (p.11-15)
  12. (1.5) Modify [view] templates (p.15-17)
  13. (1.6) Save the changes (p.17-18)
  14. (1.7) Refresh the browswer and perform user operation (p.19-21)
  15. (1.8) Observing the database tables (p.22-26)
  16. (1.9) Use Rails Console (p.26-28)
  17. EXERCISE #2: Options for has_many (p.28-46)
  18. (2.0) Create fresh test data using migration (p.28-33)
  19. (2.1) Exercise :order option (p.34-39)
  20. (2.2) Exercise :destroy option (p.39-46)
  21. EXERCISE #3: Add many-to-many association to rubyweblog application (p.46-65)
  22. (3.1) Create Category model class (p.46-49)
  23. (3.2) Create "categories_posts" table through migration (p.49-55)
  24. (3.3) Add many-to-many relationship between Post and Category models (p.55-58)
  25. (3.4) Create test data through migration (p.59-64)
  26. (3.5) Use Rails Console (p.64-65)
  27. EXERCISE #4: Add many-to-many association to rubyweblog application using through - not ready yet
  28. (4.1) Recreate rubyweblog_development database (p.66-68)
  29. (4.2) Remove migration files that are not needed (p.68-69)
  30. (4.3) Create a join model (p.70-73)
  31. (4.4) Modify Post and Category models (p.73-75)
  32. (4.5) Create test data through migration (p.75-79)
  33. (4.6) Verify that the data tables are created correctly (p.79-83)
  34. (4.7) Use Rails Console (p.83-84)
  35. Finished Exercises (4:30pm)
  36. Homework (p.84)

Sunday, April 19, 2009

Week 9: Rails Passion Course

  1. Week 9: ActiveRecord Basics (Topics covered: What is Active Record?, Active Record Object Creation, Find operation, Dynamic Attribute-based Finders, Validation, Migration, Callbacks, Exception Handling)
  2. Week 9 Resources
    1. Basics
      1. ActiveRecord from api.rubyonrails.org
      2. ActiveRecord::Base API from api.rubyonrails.org
      3. ActiveRecord tutorial screencast by Gregg (July 2007)
      4. Advanced ActiveRecord presentation by Obie Fernandez
    2. Validation
      1. ActiveRecord::Validations::ClassMethods API document from rubyonrails.com
      2. Various examples from railsbrains.com
    3. Migration
      1. ActiveRecord::Migration API document from railsbrains.com
      1. Generate a migration from an existing MySQL database posting in ruby-forum.com
  3. 5522_rails_activerecord.zip (Unzip it in a directory of your choice and read lab document from /jrubyrails_basics/index.html to proceed) (4/19/09: Downloaded)
  4. Presentation --PDF: 1 slide per page (OR) OpenOffice file (44 pages) (4/21/09: Read)
  5. Online Lab/Change Log document (This is the same document you will find in the hands-on lab zip file) (105 pages)
  6. EXERCISE #0: Start MySQL database server. (p.2)
  7. EXERCISE #1: Creation of ActiveRecord Objects (p.2-39)
  8. (1.1) Create a new NetBeans project (with JRuby 1.1.4 and WEBrick) (p.3-6)
  9. (1.2) Create database (p.6-7)
  10. (1.3) Generate Model (3 attributes) (p.8-10)
  11. (1.4) Create database table through migration (p.10-19)
  12. (1.5) Create ActiveRecord objects through Rails Console (p.20-28)
  13. (1.6) Create database table rows through migration (p.29-39)
  14. EXERCISE #2: ActiveRecord#find (p.40-44)
  15. (2.1) find(:all) with various options (p.40-42)
  16. (2.1.1) With limit, offset, select options (p.40)
  17. (2.1.2) With order parameter (p.40-41)
  18. (2.1.3) With conditions parameter (p.41-42)
  19. (2.2) find(:first) (p.42)
  20. (2.3) find() with id (p.42)
  21. (2.4) Dynamic attribute-based finders (p.42-43)
  22. (2.5) find_by_sql method (p.43)
  23. (2.6) find_or_create_by_ method (p.43-44)
  24. (2.7) find() with params (44) -- EMPTY/SKIPPED
  25. EXERCISE #3: Validation (p.44-75)
  26. (3.1) Delete all rows of the "users" table through migration (p.44-49)
  27. (3.2) Perform validation using validation helpers (p.50-60)
  28. (3.3) Add email field to the users table (p.61-69)
  29. (3.4) Add validation logic for the "email" field (p.70-71)
  30. (3.5) Perform validation testing on the email field (p.72-75)
  31. EXERCISE #4: Migrations (p.76-105)
  32. (4.1) Add a new column (p.76)
  33. (4.2) Rename a column - chane "email" to "email_addr" (p.76-83)
  34. (4.3) Roll back the change - change "email_addr" to "email" (p.84-89)
  35. (4.4) Display "schema.rb" file that maintains the current migration number (p.90-91)
  36. (4.5) Exercise with multiple veresions of migration files (p.92-105)
  37. EXERCISE #5: Statistics (p.106-107)
  38. EXERCISE #6: Callbacks (p.108--114)
  39. (6.1) Add callback to the Model (p.108-114)
  40. FINISHED EXERCISES (11:38am on 4/21/2009)
  41. Homework (p.115)
  42. HW-part 1: Migration: Add another column called "credit_card" to the users table as following as part of ActiveRecord_Creation project. (Or you can create a new project and new database. I will call the new project as MyActiveRecord here.) The type of credit_card field is string. (4/21/09: done, HINT ON PAGE 76) OUTPUT: (in C:/cygwin/home/jasnow/RAILSPASSION/ActiveRecord_Creation)
    == 20090421151649 RenameEmailField: migrating =================================
    -- rename_column(:users, :email, :email_addr)
    -> 0.2011s
    == 20090421151649 RenameEmailField: migrated (0.2018s) ========================
    == 20090421162301 AddCreditCxard: migrating ===================================
    -- add_column(:users, :credit_card, :string)
    -> 0.1927s
    == 20090421162301 AddCreditCxard: migrated (0.1933s) ==========================
  43. HW9-part 2: Validation: Add the following validation logic for the credit_card field.
    1. It has to be unique.
    2. User can enter the credit card format in the following format. The x has to be numeric value.
      1. xxxx-xxxx-xxxx-xxxx (format #1)
      2. xxxx xxxx xxxx xxxx (format #2)
      3. xxxxxxxxxxxxxxxx (format #3) NOTE: 16 digits
  44. HW9-part3: Callbacks: Use callbacks - before_save and before_create - to convert the format #1 and format #2 to format #3 meaning the actual table contains only format #3. (4/21/09: done, HINT ON PAGE 108) Loading development environment (Rails 2.1.0)
    RAILS CONSOLE: JRuby limited openssl loaded. gem install jruby-openssl for full support.
    http://wiki.jruby.org/wiki/JRuby_Builtin_OpenSSL
    >> ?> user = User.new(:name => "OnlyDigits", :hobby => "tennis", :age => 49, :email_addr => "jasnow@hotmail.com", :credit_card => "1234567890123456" )
    => #
    >> user.save
    => true
    >> user = User.new(:name => "Digits N. Blanks", :hobby => "swimming", :age => 19, :email_addr => "dnbxxx@gmail.com", :credit_card => "1234 5678 9012 3456" )
    => #
    >> user.save
    => true
    >>
    User.create(:name => "Digits N. Dashes", :hobby => "swimming", :age => 19, :email_addr => "dndxxx@gmail.com", :credit_card => "1234-5678-9012-3456" )
    ?> => #
    >> User.create(:id => 20, :name => "Bad DashInColumn1", :hobby => "swimming", :age => 19, :email_addr => "bdc1xxx@gmail.com", :credit_card => "-1234567890123456" )
    => #
    >> user = User.new(:name => "Bad DashInColumn1", :hobby => "swimming", :age => 19, :email_addr => "bdc1xxx@gmail.com", :credit_card => "-1234567890123456" )
    => #
    >> user.save
    => false
    >>
    ?> user = User.new(:name => "BadDashInColumn1", :hobby => "swimming", :age => 19, :email_addr => "bdc1xxx@gmail.com", :credit_card => "-1234567890123456" )

    => #
    >> ?> user.save
    => false
    >> user = User.new(:name => "BadValue", :hobby => "swimming", :age => 19, :email_addr => "bdc1xxx@gmail.com", :credit_card => "BAD VALUE" )
    => #
    >> user.save
    => false
  45. HW9-part4: Submit: Send the following files to railshomeworks@sun.com with Subject as RailsHomework-rails_activerecord.
  • Zip file of the the MyActiveRecord NetBeans project. (Someone else should be able to open and run it as a NetBeans project.) You can use your favorite zip utility or you can use "jar" utility that comes with JDK as following.
    • cd MyActiveRecord directory> (assuming you named your project as MyActiveRecord)
    • jar cvf MyActiveRecord.zip MyActiveRecord (MyActiveRecord should contain nbproject directory)
  • Captured output screen - name it as RailsHomework-rails_activerecord.gif orRailsHomework-rails_activerecord.jpg (or RailsHomework-rails_activerecord.)
    • Any screen capture that shows that your program is working is good enough.
  • Emailed on 4/21/2009/DONE with your lesson.

Week 8: Rails Passion Course

  1. Week 8: Ruby/JRuby and Rails Support in NetBeans (Topics covered: Coding/Editing, Refactoring, Testing, Debugging, Profiling, Deployment)
  2. 5553_rails_netbeans.zip (Unzip it in a directory of your choice and read lab document from /rails_netbeans/index.html to proceed) (4/19/09: Downloaded)
  3. Week 8 Resources
    o Websites
    + NetBeans Ruby and Rails Learning Trail
    + NetBeans Ruby wiki
    o Database
    + Ruby Database Integration with NetBeans 6.1 from wiki.netbeans.org
    + Using MySQL Administrator Tool of NetBeans 6.1 Beta blog
    o Rails support in NetBeans blogs
    + Surprising Contender: NetBeans as a Ruby+MYSQL IDE blog by Timothy M. O'Brien (April 2008)
    + So long TextMate?... Hello NetBeans? Really? Yeah, really. blog (April 2008)
    + Tor Norbye's Weblogs
    + Why You Want NetBeans (for Rails development) blog by Eric Armstong (May, 2008)
    # See the end part of the blog.
  4. Presentation - PDF: 1 slide per page (OR) OpenOffice file (36 pages) (4/19/09: Read)
  5. Online Lab/ChangeLog document (This is the same document you will find in the hands-on lab zip file) (2 pages)
  6. EXERCISE 1 (60 minute screencast): In this exercise, you are going to watch and listen variious NetBeans screencasts from the NetBeans Ruby and Rails Learning Trail website and try them yourselves.
  7. (1.1) Using Code Completion (2:04 minutes)
  8. (1.2) Using Hints and Quick Fixes (3:21 minutes)
  9. (1.3) Using Live Code Templates (2:29 minutes) (http://ruby.netbeans.org/codetemplates-ruby.html)
  10. (1.4) Editing Ruby Code (4:55 minutes)
  11. (1.5) Debugging Ruby Code (4:38 minutes)
  12. EXERCISE 2 (30 minute screencast): In this exercise, you are going to exercise various Ruby editing features of NetBeans.
  13. (2.1) Ruby Editing features (4/19/09: Printed out and read this section - 14 pages)
  14. Homework (No Homework)

Thursday, April 16, 2009

Week 7: Rails Passion Course

  1. Week 7: Scaffolding (Scaffolding is a way to quickly put an Active Record class online by providing a series of standardized actions for listing, showing, creating, updating, and destroying objects of the class. These standardized actions come with both controller logic and default templates that through introspection already know which fields to display and which input types to use. // Topics covered: What is scaffolding?, Controller (that is generated through scaffolding), Templates (that are generated through scaffolding))
  2. 5523_rails_scaffold.zip (Unzip it in a directory of your choice and read lab document from /rails_scaffold/index.html to proceed) (4/16/09: Loaded)
  3. Week 7 Resources
    o Web services, Rails-style blog by Jamis (March, 2006)
    + Explains how respond_to works - respond_to will be covered in REST topic below
    o Rails 2.0 Scaffolding blog by David Lynch
  4. Week 7 Presentation - PDF: 1 slide per page (OR) OpenOffice file (15 pages) (4/16/09: Read)
  5. Week 7 Exercises -Online Lab/Change Log document (This is the same document you will find in the hands-on lab zip file) (72 pages) (4/17/09: Read thru the powerpoints)
  6. #0: Start Db (done) (p.2)
  7. (1.1) Create new project: rubyweblog with WEBrick and JRuby 1.1.4. (p.3-4)
  8. (1.2) Create new database (p.4-5)
  9. (1.3) Generate scaffold (p.6-18)
  10. (1.4) Migrate the database (to Current Version) (p.19-21)
  11. (1.5) Add a URL routing and delete index.html from Public directory (p.22-25)
  12. (1.6) Build and run the application (p.26-27)
  13. (1.7) Study control flow - Displaying the 1st page (p.28-31)
  14. (1.8) Study control flow - Creating a new post (p.31-37)
  15. EXERCISE #2: Add another field to the model in rubyweblog application
  16. (2.1) Add another field to the model (through migration) (p.37-41)
  17. (2.2) Modify [view] templates (p.42-44)
  18. (2.3) Save changes and Refresh the browser (p.45-53)
  19. (2.4) Add a validation (p.54-59)
  20. (2.5) Change the look and feel (p.60-62)
  21. (2.6) Perform various find operations through Rails console (p.63-67)
  22. NOW FOR THE HOMEWORK
  23. Week 7 Homework (68 pages) (p.67-68)
  24. HW7: Step 1: Start DB. (p.2)
  25. HW7: Step 2: Create new project (myscaffoldingapp) with WEBrick and JRuby 1.1.4. (p.2-3)
  26. HW7: Step 3: Now create databases. (p.3-4)
  27. HW7: Step 4: Now create scaffold - Course model with 2 attributes (name:string and credit:integer) (p.6-10)
  28. HW7: Step 5: Now migrate the database. (p.11-21)
  29. HW7: Step 6: Fix Configuration (routes.rb == "courses", deleted index.html) (p.22-25)
  30. HW7: Step 7: Build/Ran (p.26-27) http://localhost:3000/courses/new (WORKED; Added 7 courses/credits)

Week 6: Rails Passion Course - On My New Mac

  1. Repeated Week 6 Homework (HW6) on my new White Mac Laptop.
  2. (AL#1) Creating new project: studentapp in /Users/whitemac/NetBeansProjects directory using "Built-in JRuby 1.1.4" and "Glassfish V3".
  3. Note the Mac experience is different from PC. Asked for Database Configurations/Accepted defaults/Continued.
  4. Then went to "Install Rails" and I selected "Update JRuby OpenSSL Support" and it worked. Then I selected "Update Rails" (from 2.1.0) to 2.3.2.
  5. Then I SKIPPED "Install Warbler" for now.
  6. Selected "Finished" and it failed and asked for run "sudo gem update --system" so I did. After the "gem update" finished, I selected "OK" and it finished creating the Rails Project.
  7. NOTE: Appears that MySQL is not installed on MAC, so going back to AL#0 to install MySQL on the MAC.
  8. THURSDAY (Next Day): Found another article (http://sheldonconaty.com/?p=7) and followed it to use this article: http://www.hennessynet.com/blog/?p=40 about setting up .bash_profile and macports and mySQL.
  9. Here is the log: $ sudo port install mysql5 +server (p.1)
    ---> Fetching zlib
    ---> Attempting to fetch zlib-1.2.3.tar.bz2 from http://www.zlib.net/
    ---> Verifying checksum(s) for zlib
    ---> Extracting zlib
    ---> Applying patches to zlib
    ---> Configuring zlib
    ---> Building zlib
    ---> Staging zlib into destroot
    ---> Installing zlib @1.2.3_2
    ---> Activating zlib @1.2.3_2
    ---> Cleaning zlib
    ---> Fetching openssl
    ---> Attempting to fetch openssl-0.9.8k.tar.gz from http://distfiles.macports.org/openssl
    ---> Verifying checksum(s) for openssl
    ---> Extracting openssl
    ---> Applying patches to openssl
    ---> Configuring openssl
    ---> Building openssl
    ---> Staging openssl into destroot
    ---> Installing openssl @0.9.8k_0
    ---> Activating openssl @0.9.8k_0
    ---> Cleaning openssl
    ---> Fetching ncursesw
    ---> Attempting to fetch ncurses-5.7.tar.gz from http://mirrors.ibiblio.org/pub/mirrors/gnu/ftp/gnu/ncurses
    ---> Verifying checksum(s) for ncursesw
    ---> Extracting ncursesw
    ---> Configuring ncursesw
    ---> Building ncursesw
    ---> Staging ncursesw into destroot
    ---> Installing ncursesw @5.7_0
    ---> Activating ncursesw @5.7_0
    ---> Cleaning ncursesw
    ---> Fetching ncurses
    ---> Verifying checksum(s) for ncurses
    ---> Extracting ncurses
    ---> Configuring ncurses
    ---> Building ncurses
    ---> Staging ncurses into destroot
    ---> Installing ncurses @5.7_0
    ---> Activating ncurses @5.7_0
    ---> Cleaning ncurses
    ---> Fetching readline
    ---> Attempting to fetch readline-6.0.tar.gz from http://distfiles.macports.org/readline
    ---> Verifying checksum(s) for readline
    ---> Extracting readline
    ---> Applying patches to readline
    ---> Configuring readline
    ---> Building readline
    ---> Staging readline into destroot
    ---> Installing readline @6.0.000_1
    ---> Activating readline @6.0.000_1
    ---> Cleaning readline
    ---> Fetching mysql5
    ---> Attempting to fetch mysql-5.0.77.tar.gz from http://mysql.orst.edu/Downloads/MySQL-5.0
    ---> Attempting to fetch mysql-5.0.77.tar.gz from http://mysql.mirrors.pair.com/Downloads/MySQL-5.0/
    ---> Verifying checksum(s) for mysql5
    ---> Extracting mysql5
    ---> Applying patches to mysql5
    ---> Configuring mysql5
    ---> Building mysql5
    ---> Staging mysql5 into destroot
    ---> Creating launchd control script
    ###########################################################
    # A startup item has been generated that will aid in
    # starting mysql5 with launchd. It is disabled
    # by default. Execute the following command to start it,
    # and to cause it to launch at startup:
    #
    # sudo launchctl load -w /Library/LaunchDaemons/org.macports.mysql5.plist
    ###########################################################
    ---> Installing mysql5 @5.0.77_2+server
    ******************************************************
    * In order to setup the database, you might want to run
    * sudo -u mysql mysql_install_db5
    * if this is a new install
    ******************************************************
    ---> Activating mysql5 @5.0.77_2+server
    ---> Cleaning mysql5
    al-snows-macbook:~ whitemac$
    al-snows-macbook:~ whitemac$ sudo launchctl load -w /Library/LaunchDaemons/org.macports.mysql5.plist
    Password:
  10. Then did this:
    $ sudo -u mysql mysql_install_db5
    Password:
    Installing MySQL system tables...
    090416 20:07:40 [Warning] option 'max_join_size': unsigned value 18446744073709551615 adjusted to 4294967295
    090416 20:07:40 [Warning] option 'max_join_size': unsigned value 18446744073709551615 adjusted to 4294967295
    090416 20:07:40 [Warning] Setting lower_case_table_names=2 because file system for /opt/local/var/db/mysql5/ is case insensitive
    OK
    Filling help tables...
    090416 20:07:40 [Warning] option 'max_join_size': unsigned value 18446744073709551615 adjusted to 4294967295
    090416 20:07:40 [Warning] option 'max_join_size': unsigned value 18446744073709551615 adjusted to 4294967295
    090416 20:07:40 [Warning] Setting lower_case_table_names=2 because file system for /opt/local/var/db/mysql5/ is case insensitive
    OK
    To start mysqld at boot time you have to copy
    support-files/mysql.server to the right place for your system
    PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
    To do so, start the server, then issue the following commands:
    /opt/local/lib/mysql5/bin/mysqladmin -u root password 'new-password'
    /opt/local/lib/mysql5/bin/mysqladmin -u root -h al-snows-macbook.local password 'new-password'