Rails, Controllers, and MVC

7th lecture, May 27, 2019

Projects in Information Technology II

http://www.sw.it.aoyama.ac.jp/2019/Projects2/lecture7.html

Martin J. Dürst

AGU

© 2019 Martin J. Dürst 青山学院大学

ミニテスト

 

Today's Schedule

 

Last Lecture's Exercise 6b:
Web Page with Wrestler Table

Problem: Many different parts of processing are mixed up. This may work for such a small example, but will not scale.

 

Course Overview

 

Creating a Rails Application

 

Rails Directory Structure

 

The app Directory

 

MVC - Model-View-Controller

A diagram of Model-View-Controller, showing the controller at the top, the view at the bottom left, and the model at the bottom right

 

MVC Limits

 

MVC in Rails

A diagram depicting MVC in Ruby on Rails

 

Rails Controller

 

Rails View

 

Rails Routing

 

Rails Commands Used Today

All commands except rails new have to be executed in the application directory.

 

Why is Rails So Slow?

 

Exercise 7a: Create a Rail Application

 

Exercise 7b: Say Hello

 

 

Exercise 7c: Say Goodbye

 

Homework

Find at least 3 explanations on the Web about MVC. Read and compare them.