Saturday 8 October 2016

[08/10] Ruby on Rails Workshop - Setting Up Nitrous.io & Framework Basics

Today I went to a HackerSchool workshop session by NUS Hackers. The framework for today's workshop was Ruby on Rails. The reason I decided to go to this workshop was because I wanted to learn a web framework that is being fairly widely used but also has a lot of good things to learn from. I'd heard that Ruby on Rails has a very interesting structure (which I learned today that it's called MVC) and I wanted to enhance my understanding of webs through this.

First I'm going to spend some more time understanding what MVC is.

MVC (Model - View - Controller) Framework

Source: https://www.youtube.com/watch?v=1IsL6g2ixak

  • It's an 'architectural paradigm' (1979) - it's not a framework!
  • It's used by: Ruby on Rails, Django, Lavavel, CakePHP etc
  • 'Model' is the data part. It takes care of all the data, rules, etc of the programme
  • 'View' is what is seen by the user. It shows all the outputs
  • 'Controller' receives input from the user and passes them as orders to the model
=> come to think of it, MVC reminded me of Swift (the views, the view controllers?) and it was no coincidence because what I was using for my CaloShare app (the cocoa app bits) was MVC. More info here: https://developer.apple.com/library/content/documentation/General/Conceptual/DevPedia-CocoaCore/MVC.html

Benefits?
1. Clear structure (so structure is important)
2. No repeating

Some things I remember that were 'striking'(??) during today's workshop
1. Embedded Ruby within the HTML codes
2. The resource : command
3. Migrating
4. Routes - the instructor went through it briefly, but it's a very interesting concept and is crucial to understand for any framework. Route processing is basically leading the path to what the user requests. I learned the command 'rake routes' to check how the routes are configured.

Setting up Nitrous.io

The NUS Hackers team introduced this great tool called 'Nitrous' it's basically where you can easily code your prototypes without the hassle of setting up the individual languages or frameworks. 

Learning Ruby

The order's a bit mixed up, but I've also been learning the ruby language here:
http://tryruby.org/levels/3/challenges/1
Not very relevant to what I learned today but it's nice to know the language properly.

Next?

I followed the workshop pretty well today but I haven't understood the big overarching concept(s) and ideas of Rails yet. I think I'll start a tutorial on Youtube and build something simple as a practice.

https://www.youtube.com/playlist?list=PLw3DVCAvDGUtrWrm0s2zxnbrgzkG5YAfF

No comments:

Post a Comment