Routing and Rails

After focusing on Ruby in week one, we’ve since moved on. An eight hour class day was spent on learning HTML and CSS. As our instructor pointed out, this would be the driest day of learning.

That it was.

Fortunately they’re easy to understand syntaxes, unfortunately, especially with CSS, they’re imprecise. While it’s fun to experiment with changing colors, making borders, etc. etc.; trying to center something in CSS is like trying to not let the marble fall in the hole in Labyrinth. See picture below:

labyrinth

After our HTML and CSS day, we finally began learning Rails, which will essentially be the focus of the class.  This week we have been learning how to set up RESTful routes, creating SQLite databases following the CRUD guidelines, generating controllers, and creating viewable pages of HTML with embedded Ruby in them.

We’ve also done some work on styling with Bootstrap, and added some CSS of our own. As of right we have about four or five different apps that we’re constantly working on improving. A couple of these look presentable, but their functionality is limited to mostly acquiring and returning information to the user.

Ruby is becoming more understandable, but object-oriented programming is still difficult, especially outside of Rails. Figuring out the logic to solve a lot of the problems hasn’t been too difficult, but finding a .method or the correct syntax to solve a problem can be time consuming. Sometimes it even feels like cheating.

For example we were given a weekend exercise that asked us to find the longest word in a sentence. After splitting the sentence into an array, it turns out Ruby has a method called .max_by that just returns the longest string in the array. Pretty cool. What wasn’t cool was that this method wasn’t listed in Rubydocs’s Array section but rather their Enumerables section.

Today we’re preparing to learn SQL, so more about that next time.

Advertisements

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