Ruby on Rails Tutorial: Chapter 2

Pretty simple chapter. Got through it within an hour.  After working on CakePHP there is quite a bit of similarities between the two MVC frameworks.  Glad I got some work in on CakePHP to prepare me for this.

OK spoke too soon. Failed to upload the db to heroku through the given command line call. Ohh well not a interesting example anyways. Funny thing in the book it wrote that if you can understand the scaffolding you probably shouldn’t be reading the book. I thought the scaffold code makes sense maybe I can skip some sections then.

Also an error with Rails 4.0 it doesn’t use the attr_accessible anymore so it seems the book’s way of doing validation is old. From this blog is seems the controller can do the validation from within it now. It can access the attributes without declaring them in the Model which is nice. I thought that was a bit superfluous but could see that it’s probably a security thing I guess.

For example they both something to describe the relationship.

For User, hasMany microposts.

Microposts belongs_to Users

Advertisements
This entry was posted in Book, Coding, RoR and tagged . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s