MVC In Use

Adam Eubanks
A free video tutorial from Adam Eubanks
Self Taught Programmer And Learning Enthusiast
4.3 instructor rating • 7 courses • 153,315 students

Lecture description

You know what MVC is, and how Ruby on Rails uses it, but how does MVC work directly in Ruby on Rails?

Learn more from the full course

Learn Rails: Quickly Code, Style and Launch 4 Web Apps

Kickstart your web development career by building 4 functional web apps in Ruby on Rails with Heroku, Git and Bootstrap

02:42:58 of on-demand video • Updated

  • Style with Bootstrap themes
  • Use Git and Heroku for deployment
  • Learn Rails Scaffolds, Controllers, Models, etc.
  • Implement several popular gems (devise, social_share, etc.)
English [Auto] So we know about and. What how is it actually used in our application and all the MVC stuff is basically in our Apps folder over application. So I have our application open and we're going to go into app and you see we have a controller folder a model's folder in a folder we're just perfect so open all three of those folders up so you can see them better. So first I'm going to be talking about the controllers and you see we have an application controller and items controller and then inside the views we have items with all the item views and layouts which goes on every single view. So up an item the RBC the database doesn't really have to do anything but we could say something like belongs to a user. If we wanted to associate an item with the user but we don't. So I'm just going to reverted back. All right. Similarly if we go to the items controller you see it says the index is all the items. We also have how to create a new item how to update an item destroy an item. All that stuff which gets rendered in the news which is an HMO thought EAB. So yeah you see if we go to index we have a items that each do and it's saying items equals item. All to show all of the items and in here it's just displaying that data in the items view from the items controller index action. So guys is pretty much MVC for you and I'll see you in the next video.