Skip to content

Instantly share code, notes, and snippets.

@victorclee
Last active May 7, 2017 18:55
Show Gist options
  • Save victorclee/43837fce202259ebaef518d76b773cac to your computer and use it in GitHub Desktop.
Save victorclee/43837fce202259ebaef518d76b773cac to your computer and use it in GitHub Desktop.
TIL

TIL - Things I Learned 20170507

Today is Sunday! Start of another week! We are starting out our third week of in-person class. Although we are only three weeks in, but adding on with the 4 weeks of prework, oh man, it feels a lot longer than that! So far, it's been pretty challenging, considering how packed my days have become now... But! Eyes on the prize! We can do this!

Restful Routing

Quoting from http://restfulrouting.com/#introduction, there are Golden Seven actions.

INDEX

SHOW

NEW

CREATE

EDIT

UPDATE

DESTROY

It utlizes HTTP verbs to keep unique paths to a minimum, while optimizing your controllers structure.

By learning the seven golden route actions, we can make our webpage dynamic and be able to interact with user input. After all, that's what makes it fun! Who likes to read static "about me" webpages all the time anyways.

I'll try to breifly go through the concepts that I learned today, in words to my understanding.

First,

INDEX

You use index as the main page to display all of your information. The name itself is pretty self-explanatory lolz

Next,

SHOW

You use show to let the user link to a separte webpage, showing only the specific object, item, or info that the user has clicked on. When we input objects into our database, each of them comes with a unique ID. We can then use the ID number, to call up the correlated page view, so you can read the targeted content of your desire.

NEW and CREATE

You should always use these two as a paired action. In NEW, we will use a form to gather user input, and then save the new information into our database. After it is saved, the server will then direct the user to the CREATE page, telling the user that the input has been saved and a new object has been created in the database. Like a confirmation page.

EDIT and UPDATE

These two are also paired actions. With EDIT and UPDATE, you target a specific object, using it's unique ID number, to edit a certain part (or all) of it's information. For example, you can edit the price of an item on sale, or maybe its description... etc.

DESTROY

Just like the sound of it, it deletes an object in your database entirely. Use only when needed and be caution with it.

A useful website http://guides.rubyonrails.org/routing.html#crud-verbs-and-actions

Something else...

As of any Sundays, we use the afternoon portion of class to discuss the soft skills needed in order to be hireable as a web developer. This blog post is exactly the results of that! With the limited amounts of experience and knowledge as an aspired web developer, I hope to share whatever I've learned so far to any other developers who might find it useful.

The journey of coding is, just in the name, a journey. There is no end to developing and learning, we just keep on going and keep on creating awesome stuff! And we do this together as developers united!

More updates will follow. PTL!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment