“Ruby on Rails is an open-source web framework that’s optimized for programmer happiness and sustainable productivity. It lets you write beautiful code by favoring convention over configuration” …. says the official website for Ruby on Rails.
But of course why Ruby on Rails?
Ruby is a general purpose, high level web programming language which is a programmer’s delight; especially the programmers who love C and Java. It is interpreted like Perl and Python and follows OOPs principles jut like Java, Smalltalk and Ada. Ruby is open-source and easy to both – learn and extend. It minimizes coding and reduces the chances of bugs by its conceptual elegance.
Rails on the other hand is quite simply put, is a library or a full stack framework for extending the Ruby programming language. It is written in Ruby itself and transforms into a robust web application framework. It is much faster than a traditional java framework and works wonder for developing database driven web apps. Rails code is added to the Ruby programming language to translate into a powerful combination.
The Features of Ruby on Rails:
CoC – Convention over configuration
Most web development frameworks for .NET or Java force programmers to write pages of configuration code. If suggested naming conventions are followed, Rails doesn’t need much configuration. Rails is an opinionated software, which means that the developer does not need to write configuration code if default naming conventions are followed. The increase in productivity is worth mentioning and as similar names are used by all developers, collaboration is quicker and logical.
DRY – Do not Repeat Yourself
DRY is a widely used principle by Rail developers to avoid duplicity and code reuse with the intention of keeping things uncomplicated and simple enough and avoiding repetitive tasks.
MVC – Model View Controller
Ruby on Rails uses a model view controller for implementing user interfaces to implement user interfaces responding to the external requests from web servers using RESTful routes.
The Basic Development Environment Tools of Ruby on Rails:
• Scaffolding
This is the method to have temporary code to get an idea of how the final functioning of the components together might work. Rail is a popular framework to automatically create scaffoldings for reference.
• WEBrick To construct MVCs for websites
It is the Ruby frontend web server to connect to the internet. WEBrick is distributed with Ruby on Rails but the frontend web server job can also be assigned to Lighttpd, Apache or Cherokee as well.
• Rake
Rake is a build automation tool used to define tasks and dependencies in a name space. It is a part of the standard Ruby Library and is developed using Ruby itself.
JavaScript and Ruby on Rails
This very comprehensive framework exploits and meaningfully uses the JavaScript libraries Prototype and Script.aculo.us. Without remaining orthodox, it allows Prototype to be completely replaced by JQuery with CoffeeScript as the default JavaScript language.
WebServices
The web services are RESTful web services and also offer XML besides HTML as the output formats.
Unobtrusive Javascript
The recent versions use ubobtrusive Javascript to keep logic and the web page separate.
Package Based Framework Structure
Ruby on Rails is an amalgamation of various packages to define a framework structure. Besides these packages developers always have the option of using or developing various plugins. Some of the packages are :
- ActiveRecord Mapping for Database Access
- ActiveResource Web services
- ActionPack
- ActiveSupport
- ActionMailer
- ActiveResource
Package Management
RubyGems is the native package manager for Ruby. The package manager makes it easy to create and share software libraries (gems) that extend Ruby. RubyGems provides a simple system to install gems.
As a final word, Rails 4.1.9 and 4.0.13 have been released and are ready to chug along. Truly this is one of the most promising web development tools of 2015 and the developer community waits from more from Ruby on Rails.