Karmen Blake
Agile Developer and Instructor
Categories
- Courses (15)
Archives
- June 2008 (2)
- May 2008 (10)
- April 2008 (16)
- March 2008 (8)
- February 2008 (10)
- January 2008 (14)
- December 2007 (4)
- November 2007 (7)
- October 2007 (25)
Tags
- 206 (10)
- 234 (7)
- 282 (10)
- 283 (29)
- 284 (29)
- agile (1)
- announcements (10)
- articles (2)
- assignments (10)
- contest (1)
- employment (1)
- humor (5)
- linux (5)
- location (1)
- microsoft (1)
- office (1)
- preregistration (1)
- rails (4)
- ruby (14)
- scc (2)
- scripting (4)
- syllabi (3)
- syllabus (1)
- tips (1)
- unix (2)
- video (1)
- videos (7)
- web (2)
- windows (3)
Welcome!
You'll find my course content and collaborative discussion about technology.
I teach as an adjunct faculty in the Computer Information Systems department at Spokane Community College
Presentations/Interviews
RubyLearning.com interviewCourse Technology - Ruby on Rails Presentation
Final Assignment Specifications
June 1st, 2008 | 23 comments »
CIS 284
Final
Due June 10th by midnight
- create new rails app called lastname_final
- zip up assignment
- email to kblake.scc@gmail.com
- Reiterate material covered so far this quarter
- RESTful Routes
- ActiveRecord and Validations
- Forms
- Sorting
- Layouts
- Flash messages
- Partials
- Helpers (custom and built-in (cycle, h))
- Meaningful Titles
- Before filters
- “Fat Models, Skinny Controllers”
- Pagination
- New material
- Authentication
- belongs_to/has_many associations
- Nested routes
- Create a website that allows a user to manage a collection of drinks (user has many drinks.
- Give the drink model at least 4 attributes.
- Create another model called profile and associate a user to it so that a “user has one profile”.
- The profile model must have at least 4 attributes.
- A user should be able to perform CRUD operations on their login, profile, and drinks.
- Fulfill the objectives listed above
- I usually don’t give help with EC. If you do it, cool, otherwise don’t worry about it.
- Use of one or more Ajax helpers described in Chapter 12, pages 445-467.
- Use of one or more widgets from: http://www.slideshare.net/paolo.dona/rails-widgets-by-paolo-dona-at-railstoitaly
- http://dummied.org/archives/2007/4/11/endless_pageless_an_unobstrusive_pageless_pagination_in/
- http://jimneath.org/2008/05/15/swfupload-paperclip-and-ruby-on-rails/
- Something else? Go ahead and ask me. :)
Nested Routes Lecture
June 1st, 2008 | 1 comments »
Download App
Please view in full screen
Final Assignment coming soon
May 29th, 2008 | 0 comments »
I’ll be creating another screencast showing how to do nested resources. This will be accompanied by an assignment. It should be coming out in a few days.
Model Associations Lecture
May 28th, 2008 | 3 comments »
Download App
Ok, remind me not to create screencasts after 10:00 p.m. I have another 5 minute spot towards the end where I’m off in lala land. You can fast forward through it or use it as ammunition for our next conversation. :)
RESTFul Authentication Lecture
May 22nd, 2008 | 9 comments »
Download App
I apologize for some delayed times in the screencast (plugin download starting at 1:48 to 2:50) and my space-out, air-head moment (starting at 18:30 to 22:10) on the login and logout routes. Feel free to fast forward through those sections.
Outline for next set of lectures
May 19th, 2008 | 0 comments »
RESTful Authentication- http://railscasts.com/episodes/67
- Chapter 14 of The Rails Way (NOTE: use as a reference for use not for setup because the plugin setup is different. Some code is the same and the explanations are pretty good.)
ActiveRecord Associations
- The Rails Way, Chapter 7
- http://en.wikibooks.org/wiki/Ruby_on_Rails/ActiveRecord/Associations
- http://www.patchedsoftware.com/RailsEnvy-ActiveRecord.mov (good section right on the middle of the talk)
- http://www.slash7.com/cheats/activerecord_cheatsheet.pdf
- http://biodegradablegeek.com/2007/12/26/understanding-basic-database-relationships-in-rails/ (the migration syntax is outdated, but the concepts are the same)
Nested Routes
- The Rails Way – Chapter 4
- http://www.akitaonrails.com/2007/12/12/rolling-with-rails-2-0-the-first-full-tutorial
Sorting a collection and will_paginate
May 12th, 2008 | 0 comments »
Download appView in full screen
Assignment 2
May 12th, 2008 | 9 comments »
CIS 284
Assignment 2
Due by Sunday, May 18th by midnight
- zip up rails app named lastname_app, thus, lastname_app.zip
- email and attach zipped file (do not rename zip, send as is) to kblake.scc@gmail.com
- subject line: full name, cis 284, assignment name
- You’ll be updating your KraigsList application
- Update your website to have meaningful titles
- use the
hhelper where appropriate - use the
cyclehelper to prettify your listing - clean up controllers and views using techniques shown in lectures: before_filters, helpers, and partials, skinny-contoller/fat model
- paginate your listing
- Add Web 2.0 graphic(s) to your site (Have fun but don’t go overboard (remember blink and marquee))
- http://www.simplehelp.net/2007/06/20/30-resources-to-create-your-own-web-20-site/
- Create your own: http://creatr.cc/creatr/
- Extra Credit:
- Add a select list with these options title, price, email. The select list will be used to allow a user to sort by a given field. The default will be ascending. Add a checkbox where a user can select to have the list sorted in descending order.
- Add a submit, so that when clicked does a form submission and returns a collection sorted in the user selected order.
- Use Rails helpers to generate the form elements.
will_paginate plugin
May 11th, 2008 |
For those who could not install the will_paginate plugin as shown in my lecture and book, I’ve provided a downloadable zip you can use. Download the file and unzip into your RAILS_ROOT/vendor/plugins directory. I’ve never done it this way but theoretically should work. Let me know.
Download zipped will_paginate
Assignment...
May 9th, 2008 |
coming soon…
Lecture: cycle, h, refactored partials, before_filter
May 5th, 2008 |
Download appPlease view in full screen
Outline for next set of lectures
April 30th, 2008 |
- dynamic titles (http://railscasts.com/episodes/30)
- helper methods:
- cycle (pg. 394 – The Rails Way)
- h (pgs. 319-320 – The Rails Way)
- custom helpers (chapter 11 pgs. 407+ (The Rails Way) controller-specific, application-level)
- filters (Chapter 2 – The Rails Way)
- before_filter to find a record
- Fat models, skinny controller (jamis buck, http://weblog.jamisbuck.org/2006/10/18/skinny-controller-fat-model)
- partials of collections instead of iteration (Chapter 10 – The Rails Way, http://railscasts.com/episodes/80)
- will_paginate (Chapter 11 – The Rails Way, http://errtheblog.com/posts/56-im-paginating-again, http://railscasts.com/episodes/51)
Rails: Layout and Flash notices
April 23rd, 2008 |
Concepts:- Layouts (Chapter 10)
- Flash notices
Introduction to Rails articles
April 22nd, 2008 |
Nice introductory articles about Rails:
- http://alistapart.com/articles/creatingmoreusinglesseffortwithrubyonrails
- http://alistapart.com/articles/gettingstartedwithrubyonrails
Editing data lecture
April 21st, 2008 |
Concepts- Update attributes (Chapter 6)
- Partials (Chapter 10)
- More RESTful routes (Chapter 4)
CIS 284 - Assignment 1
April 17th, 2008 |
CIS 284
Assignment 1
Due Sunday, April 27th by midnight
- zip up rails app named lastname_app, thus, lastname_app.zip
- email and attach zipped file (do not rename zip, send as is) to kblake.scc@gmail.com
- subject line: full name, cis 284, assignment name
- You’ll be creating a KraigsList with postings
- Each posting has these characteristics
- title (required)
- price (required, validate for numeric)
- email (required, validate format)
- description (required)
- location (optional)
- Allow one to create a posting
- View all postings (order by highest price)
- Display postings count
- Extra credit: provide hyperlinks to view ordered by lowest or highest price)
- Editing of postings (in a later assignment, we’ll allow users to edit their own posts only)
- Delete a posting (make sure there is a javascript confirmation before deleting)
- Use the flash notices to display what “action” just occurred
- Use a layout to contain the views
Rails Application: creating new stories and validation
April 14th, 2008 |
Concepts:- New/Create RESTful routes (Chapter 4)
- Forms and form helpers (Chapter 4 and 11)
- Validations (Chapter 8)
Starting a Rails App
April 11th, 2008 |
Concepts- ActiveRecord Basics
- Migration Basics
- Creating a controller and a view
- Download
- Unzip
- Navigate into folder and run
rake db:migrate ruby script/server
Tutorials and speed of the course
April 10th, 2008 |
Please do not get sidetracked by tutorials you find on the web. Use them as a reference for what I want you to do. Instead follow my instructor blog (and notes) for direction. Currently, I only need you to know how to create a rails app, write some erb, and link a few pages together as shown in last week’s lecture. The scaffold was something I was demonstrating to show how quickly you can get a database-driven app up and going. You can use the scaffolded code as a reference. You are not yet expected to know how the scaffolded code is supposed to work. Over the next couple of weeks we are going to build a database driven app from scratch so that I can address some very important concepts (like ActiveRecord and routing) along the way.
REST and routes
April 9th, 2008 |
Reference: Chapter 4 (The Rails Way)In Rails, by adding
map.resources :stories to config/routes.rb, you get 7 predefined routes:
- stories GET /stories {:controller=>”stories”, :action=>”index”}
- POST /stories {:controller=>”stories”, :action=>”create”}
- new_story GET /stories/new {:controller=>”stories”, :action=>”new”}
- edit_story GET /stories/:id/edit {:controller=>”stories”, :action=>”edit”}
- story GET /stories/:id {:controller=>”stories”, :action=>”show”}
- PUT /stories/:id {:controller=>”stories”, :action=>”update”}
- DELETE /stories/:id {:controller=>”stories”, :action=>”destroy”}
map.resources :stories
- POST is a CREATE
- GET is a READ
- PUT is an UPDATE
- DELETE is a DELETE
New Rails App
April 8th, 2008 |
Did everyone get a Rails app up and going? I’d like to start in on ActiveRecord and then how we apply to a web app. Does that sound cool?
Working with databases
April 6th, 2008 |
References
- Read from: “The Rails Way” – Chapter 6
- Active Record Presentation
- Migrations Presentation (ignore mysql at beginning)
Objectives
- Configure Rails to work with a database (database.yml)
- create table (migration)
- use ActiveRecord to interact with our database
- use script/console to learn how ActiveRecord works
Model
- handle application state (usually in the database)
- encapsulate business logic, such as data validation and rules applied to data
ActiveRecord
- ORM (object-relational mapping)
- Instead of dealing with database through SQL statements, ORM layer presents records as a collection of objects
- Table represents a collection of objects(stories)
- Record represents an object/model (story)
- Field represents an object attribute (title)
CRUD operations on database
- C: create, insert record into table
- R: read, select record(s) from table
- U: update, update record(s) in the table
- D: delete, delete record(s) from the table
FREE Ruby Text Editors
April 4th, 2008 |
I thought I’d start a list of text editors to use on Windows. Scite, although great for ruby editing, does not have a file explorer and Context pretty much bombed. Ugh!- Komodo Edit
- jEdit
- Netbeans
- Not Free but recommended
Notes from Lecture
April 4th, 2008 |
Notes
How did installations go at home? Share tips here.
CIS 284 - Rails Introductory Lecture
April 1st, 2008 |
Thursday
12:30 p.m.
Room 1116
CIS 284 - Research Paper
April 1st, 2008 |
http://docs.google.com/Doc?id=ddhknw46_70df9v62c8
CIS 284 - Syllabus
March 31st, 2008 |
http://docs.google.com/View?docid=ddhknw46_69gzdd2bhj
CIS 284
March 30th, 2008 |
I’ll have a syllabus up by Monday or Tuesday night. I’m thinking about coming in to do a lecture to get us started right. Any days or times work best for you?