Int this and after this following post I would try to make you able to create your first project in Ruby on Rails. I will cover this topic from scratch. I hope you will find this useful.
So, here wo go.
To understand ROR we should first know what is Ruby?
Ruby is an open-source, multi-paradigm, interpreted programming language
Open Source
We called any product an open source when the code of that product is available for free. We can use it, modify it, and reuse it for their purposes and the improvement of that product. The benefit of open source is chiefly that you get a lot more minds working on a project than a proprietary project.
Multi-Paradigm
Ruby is a multi-paradigm language because it doesn’t constrain to a single programming mindset; you can use any of the aforementioned programming (OO, procedural etc…) paradigms with no problems in Ruby.
Interpreted
If you’ve used something like Assembly, Pascal, Fortran, or C/C++, you’ve used a compiled language. “Compiled” means that you’ve had to run your code through a little compiler and it spits out some sort of native code that will run without any sort of interpretation by the computer other than by the operating system itself. This can become time consuming as your project grows larger and larger, and sometimes can even be a severe hindrance to productivity. But on the other hand, Ruby is an interpreted language, which means that there is an interpreter that reads your code and then emits native code to the operating system.
If you’ve used something like Assembly, Pascal, Fortran, or C/C++, you’ve used a compiled language. “Compiled” means that you’ve had to run your code through a little compiler and it spits out some sort of native code that will run without any sort of interpretation by the computer other than by the operating system itself. This can become time consuming as your project grows larger and larger, and sometimes can even be a severe hindrance to productivity. But on the other hand, Ruby is an interpreted language, which means that there is an interpreter that reads your code and then emits native code to the operating system.
Ruby on Rails is a framework that makes it easier to develop, deploy, and maintain web apps.
All Rails applications are implemented using the Model-View-Controller (MVC) architecture. Java developers are used to frameworks such as Tapestry and Struts, which are based on MVC. Rails applications are written in Ruby, a modern, object-oriented scripting language. Rails take Ruby to the limit, extending it in novel ways which make a programmer’s life easier. This makes our programs shorter and more readable.
The design of Rails was driven by a couple of key concepts: DRY and convention over configuration. DRY stands for Don’t Repeat Yourself—every piece of knowledge in a system should be expressed in just one place, A place often suggested by the conventions of the MVC architecture—and then move on.
Convention over configuration is crucial, too. It means that Rails has sensible defaults for just about every aspect of knitting together your application. Follow the conventions and you can write a Rails application using less code than a typical Java web application uses in XML configuration.Back in 1979, Trygve Reenskaug came up with a new architecture for developing interactive applications. In his design, applications were broken into three types of components: models, views, and controllers.
Model:The model is responsible for maintaining the state of the application. Sometimes this state is transient, lasting for just a couple of interactions with the user. Sometimes the state is permanent and will be stored outside the application, often in a database. A model is more than just data; it enforces all the business rules that apply to that data. For example, if a discount shouldn’t be applied to orders of less than $20, the model will enforce the constraint. This makes sense; by putting the implementation of these business rules in the model, we make sure that nothing else in the application can make our data invalid. The model acts as both a gatekeeper and a data store.
View:The view is responsible for generating a user interface, normally based on data in the model. For example, an online store will have a list of products to be displayed on a catalog screen. This list will be accessible via the model, but it will be a view that accesses the list from the model and formats it for the end user. Although the view may present the user with various ways of inputting data, the view itself never handles incoming data. The view’s work is done once the data is displayed. There may well be many views that access the same model data, often for different purposes. In the online store, there’ll be a view that displays product information on a catalog page and another set of views used by administrators to add and edit products.
Controller:Controllers orchestrate the application. Controllers receive events from the outside world (normally user input), interact with the model, and display an appropriate view to the user. This triumvirate: the model, view, and controller-forms an architecture known as MVC. Figure below shows MVC in abstract terms.
Summery:
In this post you seen that what is Ruby and Rails. Basic concepts of Rails and MVC architecture. In next post I will tell you Active Recored, OR Mapping , Action View and Controllers in detail. Thank you for your intrest.

