- Language: Ruby 3.0.0
- Framework: Rails 6.1.4
- Webserver: Puma
- Test Framework: RSpec
- Database: Postgres
I used devise for authentication. The user can sign_up, sign_in, sign_out using Devise's interface. Only email and password are needed.
I used pagy to paginate the index views. For those endpoints that need pagination, you should add on the controller method, for example:
@pagy, @records = pagy(User.all)And in the corresponding view:
<%== pagy_nav(@pagy) %>- Make sure that you have Rails 6, PostgreSQL, git cli, and bundle installed.
- Clone this repo using
git clone https://github.com/fdecono/contact-imported.git - Run
bundle install - Run
bundle exec rails db:create - Run
bundle exec rails db:migrate - Run
bundle exec rails db:seed - Check the test are passing running
bundle exec rspec - Run
bundle exec rails sand in your browser navigate tohttp://localhost:3000 - You will be able to log in to the App using the following credentials:
email: [email protected]
password: password
Or you can sign_up with the credentials you desire. - Once you are logged in, click the
Choose Filebutton and select thecsv_contact_list.csvfile at the root of this project. Click theImport Contactsbutton.
- I was not able to complete the whole assignment, though I tried to end up with a functioanl app, which serves the purpose of importing contacts from a .csv file.
- Regarding the validations, as I could not code them all, at least I wanted to have some of them working.
- It did not find the IIN explanation of the credit cards to be cristal clear , therefore I made a slight modification to the way that attribute is loaded.
- I am not used to using the rails views, most of my coding in RoR has been building APIs, using ActiveModelSerializers and rendering jsons for the frontend to consume. This delayed me quite a bit, but it was a lot of fun reading the docs and applying them to my code! I learnt a few things today, thanks!