Rails is web application frame work that includes everything needed to create database backed up web application according to the MVC (Model-view-Controller)
MVC architecture is for —-when you create an application like online store and it require HTML front for customers, WML(wireless markup language) for wireless customers, JFC for admins and XML for suppliers .ie different interface for different users.
When you are developing an app, you ll use one type of interface but it has to support to multiple user with different interfaces, so there ll be problem for creating an app ie in which interface we have to create, so we need to copy the non interface specific code and duplicated in each application, this takes more time for testing and maintenance, so this duplication is not effective but our goal is app has to support all interfaces
The solution is MVC, we have to create the app with MVC, here we separate core business model function from presentation and control logic that uses this functionality, this separation allows multiple views to share the same data model which make supporting multiple clients easier to implement, test and maintain this is the mail goal of MVC archicture.
Model — this is core business model which interact with database.
Veiw — its take data from model and specifies how it should look.
Controller — mainly user interact with controller, it take user inputs.
Working — controller take user inputs and interact with both model and view. First it controller takes request, get the data from model where model interact with database then controller interact with view to represent how it should