Make sure your laptop has working installation of:
- Ruby version 2.2 or above
- SQLite3 database
- RubyGems packaging system.
- Rails version 5.0 or above
- Git
Reference:
- https://gorails.com/setup
- https://git-scm.com/book/en/v2/Getting-Started-Installing-Git
- https://guides.rubyonrails.org/v5.0/getting_started.html
To start develop a new project, we need to have some data in our database so that we can test our code easily. So we need to make sure our seed file is working properly in the first place. Unfortunately some code in the seed file is broken. We will need your help to fix it.
Requirement:
- Check out to branch
fix-broken-users-seed
- Fix the broken seed file
db/seeds.rb
- Use command
bundle exec rake db:seed
to seed data to the database - Commit the code changes to the same git branch
fix-broken-users-seed
As a good software engineer, debugging skill is very crucial. There are some code are deleted/added purposely to make some of the feature not working properly. Fortunately we write some unit test to help us idenfity which area is broken. Hence, you will need to help us fix all the bugs in current code base.
Requirement:
- Check out to branch
fix-broken-users-management-pages
- Fix all the bugs that presence in
user
model, controller, and views. - Fix missing routes in
config/routes.rb
- Build a logic in validate
user
membership code format, inapp/models/user.rb
- Commit the code changes to the same git branch
fix-broken-users-management-pages
We have new feature request now. We want to let user to create new vouchers, hence we need to store the voucher information in our database. Remember, one user can always create more than 1 voucher.
Requirement:
- Create a new model
voucher
voucher
table should consists ofname
,expiry_at
,created_at
andupdated_at
.name
value must be always unique but case insensitive.- Build a one to many relationship between
user
andvoucher
models. - Commit all your changes in a new git branch
feature/new-user-vouchers-model
. - (Optional) Write unit test to make sure your code is working.
Is time to showcase your CSS/Javascript magic to develop a beautiful page.
There is no specific requirement for this part, You can continue from Part 3 or create a totally new page to showcase your html/css/javascript knowledge.