- style, add input validation
- connect mailer to heroku as extra credit
-
The main learning outcome of this project is to work with advanced forms and active record callbacks (?)
-
The task is to create a flight booking website with pre-populated form information that a potential flight customer can choose from. Then the customer adds their passenger information into another form.
-
The project can be found on The Odin Project: https://www.theodinproject.com/lessons/ruby-on-rails-flight-booker
- I spent many hours trying to figure out why my
BookingsController
was not saving the currentbooking
from thebookings#new
form. I also didn't know how to build thepassengers
for thebooking
object. After much googling, ultimately inBookingsController#new
, I followed this SO post for building thepassengers
objects (linked from the project directions as well). And I addedhidden_field
tags forflight_id
andpassenger_amt
in theviews/bookings/new.html.erb
form to pass in theparams
toBookingsController#create
.
-
Object doesn't support #inspect
kept tripping me up, I wasn't able to get aWHERE
query with aLIKE
condition on thestart_datetime
column in theflights
table. This alone kept tripping me up. Using theDate#all_day
from Rails inside theWHERE
query worked such that I didn't getObject doesn't support #inspect
. -
Flight duration conversion to human readable text and interval column
-
collection_radio_buttons
- I wanted to customize what information to put as the label for each radio button and didn't know how to incorporate that. I learned (by reading the following documentation) to put a method in the Flight model to use in the Flight views
submission_results
partial form'scollection_radio_button
text_method
- https://apidock.com/rails/v4.0.2/ActionView/Helpers/FormOptionsHelper/collection_radio_buttons
- I wanted to customize what information to put as the label for each radio button and didn't know how to incorporate that. I learned (by reading the following documentation) to put a method in the Flight model to use in the Flight views
-
form_with
hidden fields -
nested forms