This project is part of The Odin Project: Flight Booker in the Ruby on Rails curriculum.
By the end of this project, you will be able to:
- Create a Rails application that allows users to search for and book flights.
- Implement forms with dropdown menus and nested attributes.
- Utilize Rails associations for managing related models.
- Seed a database with sample data for testing.
- Create a multi-step booking process with clear user interactions.
- Search for Flights: Users can enter desired dates and airports to search for available flights.
- Select Flight: Users choose from a list of available flights returned based on their search criteria.
- Enter Passenger Information: Collect passenger details for the booking.
- Billing Information: Capture billing details for the transaction.
- Data Models: Plan and create the necessary models:
Airport
,Flight
,Booking
, andPassenger
. - Create Rails App: Generate your new Rails application, e.g.,
odin-flight-booker
, and initialize a GitHub repository. Update your README to reflect your project. - Database Seeding: Use the
db/seeds.rb
file to populate airports and flights for testing.
- Create dropdowns for departure airport, arrival airport, date, and number of passengers.
- Implement a search form on the
/flights
index page that submits using a GET request.
- Display search results on the same page with radio buttons for flight selection.
- Keep the search form active to allow new searches.
- Create a form to submit booking information and collect passenger details using nested attributes.
- Implement a
BookingsController
to handle booking logic and render a booking confirmation page.
- Ruby on Rails
- ActiveRecord for database management
-
Clone the repository:
git clone https://github.com/jambalong/flight-booker.git
-
Navigate to the project directory:
cd flight-booker
-
Install dependencies:
bundle install
-
Set up the database:
rails db:create rails db:migrate rails db:seed
-
Start the Rails server:
rails server
Access the application at http://localhost:3000
.