select-your-own-seat

Expand History Expand History
Collapse History Collapse History

Render the application’s layout

This commit adds a SeatsController class to serve requests made to routes like:

/venues/benedum_center/floors/orchestra/seats

This commit relies upon Rails’ conventional controller action rendering.

To declare a controller “action”, a controller that extends from ActionController::Base can either:

  • define an instance method that corresponds to the action (in this case, an #index instance method)

  • declare a view file named after the action in the directory that corresponds to the controller name (in this case, app/views/seats/index.html.erb)

If a method that corresponds to the action does not exist, Rails will automatically infer which template to render.

The controller has no methods defined, and declares a seats#index view template in the app/views/seats/index.html.erb file. The seats#index renders static HTML that relies upon the pre-defined CSS styling rules.

This static HTML serves as the Seats page’s layout. We’ll make the contents of the page dynamic in subsequent commits.

Desktop

seats page layout