David Uli

David Uli

Software Developer



Phase 0 - Week 8 What is Rails Anyway?

Sunday, July 19, 2015

Probably Not These Rails?

What is Rails

On May 10, 1869 a golden spike was driven in Promontory, Utah, signaling the completion of the first transcontinental railroad, making it possible to go from the east coast to the west coast of the United States in just eight days instead of a staggering 6 months by horse. Ok, so this is not the Rails that I am writing about today but they both made it easier to get from point A to point B (at least in their own time). It is possible that Ruby on Rails might not as play big of a role in changing the landscape of our country, but it has definitely gained popularity for simplifying the Ruby development process.

Ruby on Rails is an open source web application framework that is written in the Ruby programming language and is based on two key principles, Convention Over Configuration and Don't Repeat Yourself (D.R.Y.). In this blog, we will talk a little about these principles and how they can help developers save time, accomplish more and reduce the amount of code they produce. Some people say that Rails even makes web application development more fun.

Convention Over Configuration

Convention Over Configuration, refers to a set of rules or conventions that are provided by Rails to reduce the need for endless configuration files specifying every minute detail. These conventions speed up the development process, keep your code concise, readable and--most importantly--they allow you to easily navigate inside your application.

Don't Repeat Yourself - D.R.Y.

After 8 weeks at DBC, we have all talked about D.R.Y and probably received feedback at some point. The DRY principle is stated as “Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.” This principle was formulated by Andy Hunt and Dave Thomas in their book The Pragmatic Programmer. In their book, Hunt and Thomas explain that these principles are applied broadly and even include database schema, test plans, the build system, and even documentation. In addition, they also explain that when the D.R.Y. principle is applied successfully, a modification of any single element of a system does not require a change in other logically unrelated elements. While this is not unique to Rails, the principles of D.R.Y. play a big role in Rails development.

In addition to these principles, Rails provides a large collection of third party libraries or Gems to perform and/or simplify many common programming tasks. These Gems provide structured content, including the code library, test and documentation that will help you easily incorporate them into your project.

Just like most other applications, Rails applications are vulnerable to security risks, and risk mitigation should play an active part in the development life-cycle. However, the time-saving aspect of Rails can create certain security risks and applications should be reviewed closely. One example of this is the mass assignment risks which has been seen frequently in Rails applications. Mass assignment is a feature that allows you to set a bunch of attributes at once as opposed to writing assignment statements for each individual attribute. Because Rails is so convention-heavy, fields like :admin, :owner, and :public_key are easily guessable and a less than reputable person could change an attribute and/or gain access to information that was not intended.

Now that I have read a little about Rails, I can honestly say I am excited about Phase 1 so that we can get in there and start using Rails to build beautiful and exciting projects.

David Uli

Email : mail@daviduli.com

Website : http://norcaldavid.github.io

Phone : (504) 201-4466