Your task is to build an online store! Okay, maybe not a whole online store, but at least some layouts and controllers for an online store. Not only will you learn how to create a layout and how to get an action to use that layout but also how to override defaults and specify layouts on the action level.
Make a new controller called
Create a home view with an
h2 that says "Welcome to Flatiron Widgets" and a
new action in
Create a default application layout at the correct location, and add an
to it that says "Flatiron Widgets Store". This is for the main site's welcome
Create a new controller called
We want this controller to use a new layout called
admin. This layout
should have an
h1 that says "Flatiron Widgets: Admin".
Create a home view layout for
StoreAdminController with an
h2 that says
"Welcome Flatiron Admin".
Get your newly created action to use the
Create a new view for
orders with an
says "Welcome to Flatiron Open Orders". Also add an
ol with a few
elements containing fake orders.
Now you should create a new layout called
order_administration and add an
h1 that says "Flatiron Widgets: Open Orders".
At this point, the
store_admin#orders action will use the
you defined earlier, but we need it to use the new
layout. The trick is we want only the
store_admin#orders action to use the
order_administration layout, and we want to keep the
admin layout as the
default for the other actions in
Create a new action in
invoice, and insert an
h1 that says "Your Invoice".
This action is assigned the default layout for the controller,
we don't want it to use any layout at all (while also not affecting the layouts
assigned to other actions in the controller).