Web Hosting Web Hosting, web hosting, JSP, Servlets, Tomcat, website hosting, web site hosting
Web Hosting, web hosting, JSP, Servlets, Tomcat, website hosting, web site hosting
Web Hosting, web hosting, JSP, Servlets, Tomcat, website hosting, web site hosting

Alden Hosting provides professional, efficient, and reliable business-class Web hosting and Website Design services.


Call Us Toll-Free
(877) 256-0328

Outside USA
1 - (201) 505-0430


Site Map

Web Hosting Glossary -
Ruby on Rails

Ruby on Rails
Ruby on Rails, often called RoR, or just Rails, is an open source web application framework written in Ruby that closely follows the Model-View-Controller (MVC) architecture. It strives for simplicity and allowing real-world applications to be developed in less code than other frameworks and with a minimum of configuration. The Ruby programming language allows for extensive metaprogramming, which Rails makes much use of. This results in a syntax that many of its users find to be very readable. Rails is primarily distributed through RubyGems, which is the official packaging format and distribution channel for Ruby libraries and applications.


Ruby On Rails' guiding principles include "Don't Repeat Yourself" (DRY) and "Convention Over Configuration."

"Don't Repeat Yourself" means that definitions should only have to be made once. Since Ruby On Rails is a "full-stack" framework, the components are integrated so that bridges between them need not be set up manually. For example, in Active Record, class definitions need not specify the column names; Ruby can already find them from the database itself, so defining them in both the program and the RDBMS would be redundant.

"Convention Over Configuration" means that the programmer only needs to define configuration which is unconventional.

For example, if there is a Post class in model, the corresponding table in the database is posts, but if the table is unconventional (e.g. blogposts), it must be specified manually (set_table_name "blogposts").

Rails' MVC architecture

The pieces of the Model-View-Controller (MVC) architecture in Ruby on Rails are as follows:


In object-oriented, database-driven MVC web applications, Model consists of the classes representing RDBMS tables.

In Ruby on Rails, Model classes are handled through the Active Record. Usually, all the programmer needs to do is to subclass the ActiveRecord::Base class, and the program will automatically figure out which RDBMS table to use and what columns the table has.

The class definitions also specify the relations between classes with object-relational mapping commands. For example, if the class name Image has a definition has_many :comments, and there is an instance of Image named a, then a.comments will return an array with all Comment objects with image_id equal to a.id.

The data validation handlers (e.g. validates_uniqueness_of :checksum) and any update-related handlers (e.g. after_destroy :remove_file, before_update :update_related_details) are also specified and implemented in the model class.


In MVC, View is the display logic, or how the data from the Controller classes is displayed. In web applications, this frequently consists of a minimal amount of code, interspersed in HTML.

There are currently many ways the views can be handled the underlying view code is part of the Action Pack. The method in Rails itself is to use Embedded Ruby (.rhtml files), which are basically fragments of HTML with some Ruby code interspersed, with syntax quite similar to JSP. HTML and XML can also be constructed programmatically with Builder or through Liquid template system.

For each method in the controller that needs to display user output, a small HTML code fragment needs to be written. The page layout is described separately from the controller action that displays layouts, and the fragments can also call other fragments.


In MVC, Controller classes respond to user interaction and call the application logic, which in turn manipulates the data in Model and displays the data through View. In web-based MVC applications, the Controller methods are initiated by the user through the web browser.

Controller implementation is handled through Rails' Action Pack, which contains the class ApplicationController. Rails applications simply subclass ApplicationController and write required actions as methods, which can then be accessed through the web, typically in form of /example/method, which calls ExampleController#method, and presents the data using the view file /app/views/example/method.rhtml, unless the method redirects elsewhere.

Rails also provides out-of-the-box scaffolding, which can quickly construct most of the logic and views needed to do common operations, such as CRUD.

Web Hosting, web hosting, JSP, Servlets, Tomcat, website hosting, web site hosting
Add to My Yahoo!

XML icon

Add to Google












JSP at alden-servlet-Hosting.com
Servlets at alden-servlet-Hosting.com
Servlet at alden-servlet-Hosting.com
Tomcat at alden-servlet-Hosting.com
MySQL at alden-servlet-Hosting.com
Java at alden-servlet-Hosting.com
sFTP at alden-servlet-Hosting.com
JSP at alden-tomcat-Hosting.com
Servlets at alden-tomcat-Hosting.com
Servlet at alden-tomcat-Hosting.com
Tomcat at alden-tomcat-Hosting.com
MySQL at alden-tomcat-Hosting.com
Java at alden-tomcat-Hosting.com
sFTP at alden-tomcat-Hosting.com
JSP at alden-sftp-Hosting.com
Servlets at alden-sftp-Hosting.com
Servlet at alden-sftp-Hosting.com
Tomcat at alden-sftp-Hosting.com
MySQL at alden-sftp-Hosting.com
Java at alden-sftp-Hosting.com
sFTP at alden-sftp-Hosting.com
JSP at alden-jsp-Hosting.com
Servlets at alden-jsp-Hosting.com
Servlet at alden-jsp-Hosting.com
Tomcat at alden-jsp-Hosting.com
MySQL at alden-jsp-Hosting.com
Java at alden-jsp-Hosting.com
sFTP at alden-jsp-Hosting.com
JSp at alden-java-Hosting.com
Servlets at alden-java-Hosting.com
Servlet at alden-java-Hosting.com
Tomcat at alden-java-Hosting.com
MySQL at alden-java-Hosting.com
Java at alden-java-Hosting.com
sFTP at alden-java-Hosting.com
JSP Servlets Tomcat mysql Java JSP Servlets Tomcat mysql Java JSP Servlets Tomcat mysql Java JSP Servlets Tomcat mysql Java JSP at JSP.aldenWEBhosting.com Servlets at servlets.aldenWEBhosting.com Tomcat at Tomcat.aldenWEBhosting.com mysql at mysql.aldenWEBhosting.com Java at Java.aldenWEBhosting.com Web Hosts Portal Web Links Web Links JSP Web Links servlet Tomcat Docs Web Links Web Links JSP Web Links servlet Web Hosting Tomcat Docs JSP Solutions Web Links JSP Solutions Web Hosting Servlets Solutions Web Links Servlets Solutions Web Hosting Web Links Web Links . .
. .
. . . . jsp hosting servlets hosting web hosting web sites designed cheap web hosting web site hosting myspace web hosting