Ruby on Rails - Ruby on Rails MVC - ruby on rails tutorial - rails guides - rails tutorial - ruby rails



What is Ruby on Rails MVC?

  • The Model View Controller principle divides the work of an application into three separate but closely cooperative subsystems.
learn ruby on rails - ruby on rails tutorial - ruby on rails - rails code - model view controller - mvc - ajax based web application - ruby on rails examples

It basically works as following:

  • Requests first come to the controller, controller finds an appropriate view and interacts with model which in turn interacts with database and send response to controller.
  • Then controller gives the output to the view based on the response.
 learn ruby tutorial - model controller architecture in ruby rails mvc - ruby example
Learn ruby - ruby tutorial - learn ruby tutorial - model controller architecture in ruby rails mvc - ruby example - ruby examples - ruby programs

What is a Model?

  • The models are classes in Rails. They interact with database, store data, handles validation, transaction, etc.
  • This subsystem is implemented in ActiveRecord library.
  • This library provides an interface between database tables and Ruby program code that manipulates database records.
  • Ruby method names are automatically generated from database tables field names
learn ruby on rails - ruby on rails tutorial - ruby on rails - rails framework- rails web application - ruby on rails examples

What is a View?

  • View represent data in a particular format in an application for the users.
  • It handles HTML, CSS, JavaScript and XML in an application.
  • They do what controller tells them.
  • This subsystem is implemented in ActionView library.
  • This library is an Embedded Ruby (Erb) based system which define presentation templates for data presentation.

What is a Controller?

  • Controller directs traffic to views and models.
  • It query models for data from the database and display the desired result with the help of view in an application.
  • This subsystem is implemented in ActionController library.
  • This library is a data broker sitting between ActiveRecord and ActionView.
 learn ruby tutorial - process of controller in ruby rails mvc - ruby example
Learn ruby - ruby tutorial - learn ruby tutorial - process of controller in ruby rails mvc - ruby example - ruby examples - ruby programs

Directory Representation of MVC Framework

  • Assuming a standard, default installation over Linux, you can find them like this
tp> cd /usr/local/lib/ruby/gems/2.2.0/gems

tp> ls
Clicking "Copy Code" button will copy the code into the clipboard - memory. Please paste(Ctrl+V) it in your destination. The code will get pasted. Happy coding from Wikitechy - ruby on rails tutorial - rails guides - ruby rails - rubyonrails - learn ruby on rails - team
  • You will see subdirectories including (but not limited to) the following
    • actionpack-x.y.z
    • activerecord-x.y.z
    • rails-x.y.z

Over a windows installation, you can find them like this

tp>cd ruby\lib\ruby\gems\2.2.0\gems

ruby\lib\ruby\gems\2.2.0\gems\>dir
Clicking "Copy Code" button will copy the code into the clipboard - memory. Please paste(Ctrl+V) it in your destination. The code will get pasted. Happy coding from Wikitechy - ruby on rails tutorial - rails guides - ruby rails - rubyonrails - learn ruby on rails - team

You will see subdirectories including (but not limited to) the following

 learn ruby tutorial - subdirectories view in ruby rails mvc - ruby example
Learn ruby - ruby tutorial - learn ruby tutorial - subdirectories view in ruby rails mvc - ruby example - ruby examples - ruby programs

ActionView and ActionController are bundled together under ActionPack.


This ruby on rails tutorial page provides you the following key areas such as ruby , rail , ruby on rails , rail forum , ruby on rails tutorial , ruby tutorial , rails guides , rails tutorial , learn ruby , rails form_for , ruby rails , ruby class , what is ruby on rails , rails installer , ruby online , learn ruby on rails , ruby on rails jobs , rails find_by , install rails , easyrail , rubyonrails , link_to rails , ruby on rails developer , learn ruby the hard way , railscasts , ruby on rails examples , ruby on rails vs php , rails 4 , rails activerecord , rails generate , ruby and rails , ruby on rails download , install ruby on rails , ruby net http , what is rails , ruby app , ruby vs ruby on rails , ruby on rails windows , rails for zombies , ruby on rails book , ruby on rails development , ruby on rails ide , ruby on rails tutorial pdf

Related Searches to Ruby on Rails MVC