A simple Rails 6 & Ruby 3.0.0 Application to be used for practice.
- 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
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.
- Create a
Truck
model, with the following columns:
- name
- company_id
- type
- year
- capacity
- reserved (Bool)
- timestamps
- 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)
-
Make sure the
TrucksController
is tested -
Define two User roles:
admin
anddriver
admin
Users should be able to add, edit, and delete trucksdriver
Users should be able to view and reserve trucks