Tuesday, December 3, 2013

Day 58

Decided to work on Rails again today. Okay, maybe not "decided' because literally have to get this stuff down, ha. Below is part of an assignment we had to work on today. It took a little bit longer than expected. Obviously it was my computer's fault or something...  

This needed to be generated into Models using Rails.


Using the text editor, I controlled what each one of the Models did. To the right is the "User" model. Which says you need a valid email, first name, and last name. That is what the :presence => "true" is for.





Here is some of that code (<--) on the command line. This is the Message model with 5 different entries in it. Each Message belongs to a post_id and user_id. Those corresponding Id's have many messages. An author and message is required for these to work. The created_at and updated_at are automatically updated by SQlite. Must be nice, right?



- Kyle

No comments:

Post a Comment