Bits and Bytes : Rails 101
DigitalOcean

Bits and Bytes : Rails 101

From my little experience, the toughest part of learning a new language is not necessarily the semantics but the syntax; the structure of a language, and how to trace it's etymology to how things work out together. Python introduced me to M.V.C frameworks, making it more of a cheat sheet when i started developing with Ruby on Rails.

My biggest challenge however, has been how to pass values from Models to Controllers to Views, it's weird how it's easy to understand what each component does independently but relating them is somewhat easier said than done especially when you are learning a language.

This was until Nairubi taught me of a little thing called Scaffolding( guys we're throwing that word around, i was seated there wondering what that was,i talked about this event here ).The rails guide defines rails scaffolding as a quick way to generate some of the major pieces of an application. If you want to create the models, views, and controllers for a new resource in a single operation, scaffolding is the tool for the job. 

While you're developing Rails applications, especially those which are mainly providing you with a simple interface to data in a database, it can often be useful to use the scaffold method. 

Scaffolding provides more than cheap demo thrills. Here are some benefits;

You can quickly get code in front of your users for feedback.

You are motivated by faster success.

You can learn how Rails works by looking at the generated code.

You can use scaffolding as a foundation to jump start your development.

Got all this from my tutorials point class here.

$ rails generate scaffold dudette

 This simple code generates the basic M.V.C frame dynamically rails generate scaffold dudette .It will create the Model (and run your first migration), a skeleton View and Controller with CRUDE functionality(Create, Read, Update and Delete). You just did in minutes what you could have done in a day as a newbie, now you can sip some coffee and enjoy the benefits of high level programming!


To view or add a comment, sign in

More articles by Purity Maina

Others also viewed

Explore content categories