This is a simple Ruby on Rails project created as a demo for FestaLab, where you can:
- Add new users to a database
- Remove old users
- Edit user information
- View all registered users in the database
- Search for user data by any of the fields
It also includes email, CPF, and phone number validation (assuming the numbers are from Brazil) and will display an error message on the page if you try to add invalid information.
To perform email validation, we consulted the official page "Rails Guides - Active Record Validations" at this link. This validates if the email attribute's value is in the correct format, following the provided regular expression.
For CPF validation, we used a Ruby API developed by Nando Vieira, available at this link.
For phone number validation, we followed the logic provided at this link.
Here are the commands executed to create the project:
rails new demo_festalab
cd demo_festalab
rails g scaffold User name email phone cpf
rails db:migrate
Make sure you have Ruby on Rails installed. You can find installation instructions on its official page.
To run the project locally, use the following command:
./bin/dev
In addition to Ruby on Rails, it uses Tailwind CSS with the Flowbite plugin for styling and layout.