/truckers

A basic Rails 6 application for examples and practice

Primary LanguageRuby

Truckers

A simple Rails 6 & Ruby 3.0.0 Application to be used for practice.

Getting Started

  • Use Ruby 3.0.0
  • Fork the repo from Github
  • cd into Truckers
  • bundle install
  • rake db:create
  • rails db:migrate
  • rails server and the application is up and running

Scenario

This app is to help Drivers connect to Trucks that their companies own. Admin users are able to add, edit, and delete trucks in their company's fleet. Driver users are able to look at their company's fleet and reserve a truck.

alt text

Tasks

  1. Create a Truck model, with the following columns:
  • name
  • company_id
  • type
  • year
  • capacity
  • reserved (Bool)
  • timestamps
  1. Add a TrucksController to manage:
  • viewing a list of trucks
  • viewing one single truck
  • creating a new truck (admin only)
  • editing an existing truck (admin only)
  • reserve a truck (driver)
  • deleting a truck (admin only)
  1. Make sure the TrucksController is tested

  2. Define two User roles: admin and driver

  • admin Users should be able to add, edit, and delete trucks
  • driver Users should be able to view and reserve trucks