Ruby on Rails - mvc - what is mvc - model view controller- ruby on rails tutorial - rails guides - rails tutorial - ruby rails
ruby on rails tutorial tags - ruby , rail , ruby on rails , rail forum , ruby on rails tutorial , ruby tutorial , rails guides , rails tutorial , learn ruby
What is mvc ?
![learn ruby on rails - ruby on rails tutorial - ruby on rails - rails code - model view controller - mvc - what is mvc - ruby on rails examples](https://wikitechy.com/tutorials/ruby-on-rails/img/ruby-on-rails-images/what-is-mvc.png)
model view controller concepts - In Detail
![learn ruby on rails - ruby on rails tutorial - ruby on rails - rails code - model view controller - mvc - what is mvc - ruby on rails examples](https://wikitechy.com/tutorials/ruby-on-rails/img/ruby-on-rails-images/mvc.png)
model view controller folder structure - In Ruby on Rails
![learn ruby on rails - ruby on rails tutorial - ruby on rails - rails code - model view controller - mvc - ruby on rails mvc folder structure - ruby on rails examples](https://wikitechy.com/tutorials/ruby-on-rails/img/ruby-on-rails-images/ruby-on-rails-mvc-folder-structure.png)
ruby on rails database access :
![learn ruby on rails - ruby on rails tutorial - ruby on rails - rails code - model view controller - mvc - ruby on rails database access - ruby on rails examples](https://wikitechy.com/tutorials/ruby-on-rails/img/ruby-on-rails-images/mvc-database-access.png)
ruby on rails tutorial tags - ruby , rail , ruby on rails , rail forum , ruby on rails tutorial , ruby tutorial , rails guides , rails tutorial , learn ruby
ruby on rails mvc web server access : A user clicks a link to a page in a web application
![learn ruby on rails - ruby on rails tutorial - ruby on rails - rails code - model view controller - mvc - ruby on rails mvc web server access : A user clicks a link to a page in a web application - ruby on rails examples](https://wikitechy.com/tutorials/ruby-on-rails/img/ruby-on-rails-images/ruby-on-rails-jobs.png)
The web server recieves the request URL (Universal Resource Location - Uniform Resource Locator). Rails uses a routes file to match the URL with a controller action.
![learn ruby on rails - ruby on rails tutorial - ruby on rails - rails code - model view controller - mvc - ruby on rails mvc web server access : The web server recieves the request URL (Universal Resource Location - Uniform Resource Locator). Rails uses a routes file to match the URL with a controller action.](https://wikitechy.com/tutorials/ruby-on-rails/img/ruby-on-rails-images/ruby-on-rails-routes-controller.png)
![learn ruby on rails - ruby on rails tutorial - ruby on rails - rails code - model view controller - controller sample code - ruby on rails examples](https://wikitechy.com/tutorials/ruby-on-rails/img/ruby-on-rails-images/controller-sample-code-mvc-ruby-on-rails.png)
![learn ruby on rails - ruby on rails tutorial - ruby on rails - rails code - model view controller - controller sample code - ruby on rails examples](https://wikitechy.com/tutorials/ruby-on-rails/img/ruby-on-rails-images/def-index-controller-code-rby-on-rails.png)
![learn ruby on rails - ruby on rails tutorial - ruby on rails - rails code - model view controller - controller sample code - ruby on rails examples](https://wikitechy.com/tutorials/ruby-on-rails/img/ruby-on-rails-images/def-index-controller-code-ruby-on-rails.png)
![learn ruby on rails - ruby on rails tutorial - ruby on rails - rails code - model view controller - controller sample code - ruby on rails examples](https://wikitechy.com/tutorials/ruby-on-rails/img/ruby-on-rails-images/responds-to-controller-code-ruby-on-rails.png)
![learn ruby on rails - ruby on rails tutorial - ruby on rails - rails code - model view controller - controller sample code - ruby on rails examples](https://wikitechy.com/tutorials/ruby-on-rails/img/ruby-on-rails-images/format-html-for-controller-code-ruby-on-rails.png)
![learn ruby on rails - ruby on rails tutorial - ruby on rails - rails code - model view controller - controller sample code - ruby on rails examples](https://wikitechy.com/tutorials/ruby-on-rails/img/ruby-on-rails-images/format-xml-for-controller-code-ruby-on-rails.png)
The invoked controller action requests data from a model. The model queries the database and hands data back to the controller
![learn ruby on rails - ruby on rails tutorial - ruby on rails - rails code - model view controller - mvc - ruby on rails mvc web server access : The invoked controller action requests data from a model. The model queries the database and hands data back to the controller](https://wikitechy.com/tutorials/ruby-on-rails/img/ruby-on-rails-images/model-controller-mvc-pattern-ruby-on-rails.png)
![learn ruby on rails - ruby on rails tutorial - ruby on rails - rails code - model sample code - ruby on rails examples](https://wikitechy.com/tutorials/ruby-on-rails/img/ruby-on-rails-images/model-code-ruby-on-rails-mvc.png)
![learn ruby on rails - ruby on rails tutorial - ruby on rails - rails code - model sample code - ruby on rails examples](https://wikitechy.com/tutorials/ruby-on-rails/img/ruby-on-rails-images/model-code-validation-ruby-on-rails-mvc.png)
The controller action then passes data to a corresponding view. The view uses the data and a template to compose a page.
![learn ruby on rails - ruby on rails tutorial - ruby on rails - rails code - model view controller - mvc - ruby on rails mvc web server access : The controller action then passes data to a corresponding view. The view uses the data and a template to compose a page](https://wikitechy.com/tutorials/ruby-on-rails/img/ruby-on-rails-images/controller-view-in-mvc-ruby-on-rails.png)
![learn ruby on rails - ruby on rails tutorial - ruby on rails - rails code - model view view - view sample code - ruby on rails examples](https://wikitechy.com/tutorials/ruby-on-rails/img/ruby-on-rails-images/view-code-ruby-on-rails-mvc.png)
![learn ruby on rails - ruby on rails tutorial - ruby on rails - rails code - embedded ruby - view sample code - ruby on rails examples](https://wikitechy.com/tutorials/ruby-on-rails/img/ruby-on-rails-images/embedded-ruby-mvc-view-code-ruby-on-rails-mvc.png)
The controller passes the complete page to the web server.
![learn ruby on rails - ruby on rails tutorial - ruby on rails - rails code - model view controller - mvc - ruby on rails mvc web server access : The controller passes the complete page to the web server.](https://wikitechy.com/tutorials/ruby-on-rails/img/ruby-on-rails-images/controller-in-mvc-ruby-on-rails.png)
ruby on rails tutorial tags - ruby , rail , ruby on rails , rail forum , ruby on rails tutorial , ruby tutorial , rails guides , rails tutorial , learn ruby
The web server serves the page to the browser. The browser renders the new page in place of the first one.
![learn ruby on rails - ruby on rails tutorial - ruby on rails - rails code - model view controller - mvc - ruby on rails mvc web server access : The web server serves the page to the browser. The browser renders the new page in place of the first one.](https://wikitechy.com/tutorials/ruby-on-rails/img/ruby-on-rails-images/ruby-on-rails-web-server.png)
ruby on rails tutorial tags - ruby , rail , ruby on rails , rail forum , ruby on rails tutorial , ruby tutorial , rails guides , rails tutorial , learn ruby , ruby online , learn ruby on rails , install rails , rails form_for , rails find_by , install rails , rubyonrails , link_to rails , ruby on rails vs php , ruby and rails , ruby on rails download , install ruby on rails , ruby net http , what is rails , ruby vs ruby on rails
Ruby on Rails provides a framework for this MVC flow. It enables developers to work on what makes their apps unique rather than spend time re-implementing conventions.
ruby on rails tutorial tags - ruby , rail , ruby on rails , rail forum , ruby on rails tutorial , ruby tutorial , rails guides , rails tutorial , learn ruby
Ruby on Rails - Model - Resources in MVC
-
A model with a controller and a route is called a resource.
-
Resources are named with nouns.
-
In a health-related application you may find resources such as:
- Person
- Vital
- Goal
- Prescription
Ruby on Rails - Attributes in Resources of MVC model
Ruby on Rails provides a framework for this MVC flow. It enables developers to work on what makes their apps unique rather than spend time re-implementing conventions.
![learn ruby on rails - ruby on rails tutorial - ruby on rails - rails code - model view controller - mvc - ruby on rails mvc web server access : Ruby on Rails provides a framework for this MVC flow. It enables developers to work on what makes their apps unique rather than spend time re-implementing conventions.](https://wikitechy.com/tutorials/ruby-on-rails/img/ruby-on-rails-images/ruby-on-rails-mvc-complete-web-page-life-cycle.png)
ruby on rails tutorial tags - ruby , rail , ruby on rails , rail forum , ruby on rails tutorial , ruby tutorial , rails guides , rails tutorial , learn ruby
Ruby on Rails - Model - Resources in MVC
- A model with a controller and a route is called a resource.
- Resources are named with nouns.
-
In a health-related application you may find resources such as:
- Person
- Vital
- Goal
- Prescription
![learn ruby on rails - ruby on rails tutorial - ruby on rails - rails code - model view controller - mvc - model in ruby on rails](https://wikitechy.com/tutorials/ruby-on-rails/img/ruby-on-rails-images/model-in-mvc-ruby-on-rails.png)
Ruby on Rails - Attributes in Resources of MVC model
- Person.date_of_birth
- Person.height
- Person.gender
- Person.allergies
![learn ruby on rails - ruby on rails tutorial - ruby on rails - rails code - model view controller - mvc - attribute in the model of ruby on rails](https://wikitechy.com/tutorials/ruby-on-rails/img/ruby-on-rails-images/attributes-of-model-in-mvc-ruby-on-rails.png)
ruby on rails tutorial tags - ruby , rail , ruby on rails , rail forum , ruby on rails tutorial , ruby tutorial , rails guides , rails tutorial , learn ruby
Ruby on Rails - Action and Attributes in Resources for MVC model
- PersonController.create
- PersonController.show
- PersonController.update
- PersonController.destroy
![learn ruby on rails - ruby on rails tutorial - ruby on rails - rails code - model view controller - mvc - action attribute in the model of ruby on rails](https://wikitechy.com/tutorials/ruby-on-rails/img/ruby-on-rails-images/actions-attributes-of-model-in-mvc-ruby-on-rails.png)
ruby on rails tutorial tags - ruby , rail , ruby on rails , rail forum , ruby on rails tutorial , ruby tutorial , rails guides , rails tutorial , learn ruby
Ruby on Rails - Resources action and Attributes in Resources for MVC model - Embedded Ruby
- person/create.html.erb
- person/show.html.erb
- person/update.html.erb
- person/destroy.html.erb
![learn ruby on rails - ruby on rails tutorial - ruby on rails - rails code - model view controller - mvc - embedded ruby - model of ruby on rails](https://wikitechy.com/tutorials/ruby-on-rails/img/ruby-on-rails-images/embedded-ruby.png)