pcraw1027 / flatiron-bnb-controllers-and-views

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Bonus Lab: Flatiron-BnB Controllers and Views

Now that we have our model associations and methods, it's time to make this application run in the browser! We've built out our fat models, and it's time to build our skinny controllers and minimially logic-ful views. And what good will controllers be without routes and views? Well, no good at all! So we will build those too. This lab comes with the solution for the previous bnb-methods lab, so you can dive right in.

Instructions

Your basic views and controller routes will be very familiar when displaying data. Remember, that we have some related data. For example, a city has many listings therefore when we look at the show page for an individual city the listings should also be shown. For all relevant models, create the corresponding views with the associated data. This is the time to think and decide what your new forms may look like. For example, you may want to create a host with a listing in the same step so the new form for your host model may also create the associated listing.

This lab is meant to be open ended so that you have the opportunity to reason out what controllers, routes, and views you are interested in creating. At the end of this lab you want to be able to demonstrate that a user can move through your entire application end to end.

In the previous lab you built several methods. It is now time to actually use those methods. For example we have the city#city_openings method in your city.rb file. This can be used to search for available openings. See demo below:

Alt text

About

License:Other


Languages

Language:Ruby 89.5%Language:HTML 8.3%Language:CSS 1.2%Language:JavaScript 1.1%