Learnign Rails Chapter 1

After a year-long course trying to learn the basics of Ruby I’m moving on to learn Rails. I definitely would not say that I have a firm understanding of the Ruby language, or even the concepts, but I’ve learned how to google a few things. For Rails I’m using the Head First book which is a super graphic and sing-songy way to learn. It’s corny, but pretty good at helping you actually build things that you may be able to use.

In the first chapter there were a few snafus that I was able to get around with some help from the internet. First, this book is old, it’s been sitting on my desk for at least a year. In that time, a new version of Rails has been released which made things tricky. I believe the first command on the first page didn’t work because there is different syntax with Rails 3. Great!!!

I found a site that was a huge help. The blog is written by Tim van Gelder and he’s made a simple spreadsheet of the syntax changes. Find it here http://timvangelder.com/2012/02/25/using-head-first-rails-with-rails-3-x/ This was great and a quick fix.

My second issue was a bit tougher. I was so excited with my new powers that I accidentally ordered Rails to create a table, but I didn’t add any fields to the table. Of course with the scaffold command I didn’t know how to do-over. I guess that I should have just generated a migration to add fields to the table, but I wanted to do this the hard way.

I was actually able to delete the table that I created in the database SQLite3. I found a post on http://dashdingo.org/post/1627307077/sqlite3-sqlexception-table-already-exists that helped me do this. One thing to note is that Rails names the database table as a plural. I knew the website address was plural, but it wasn’t clear that the actual table is named the plural as well.

Advertisements
This entry was posted in rails. 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