Ruby on Rails - Address Book
Overview
This project is a basic intro into Rails, it creates a simple address book app. The App shows a table of all the address entries, along with a single page to view each entry. It uses basic user authentication to create private address book entries for each user_id. Each user can only read, update & delete their own address book records.
Code Repo
https://github.com/kiwiFella/RoR_addressBook_project
What I learnt during this project:
- Installing ruby on a Mac
- Ruby
generate
functions to create:- controller, view, routes
scaffolding
for database & corresponding CRUD function- migrating database
- Rails fundamentals regarding partials, routes, syntax
- Installing the
devise
gem package for user login/ logout access control. - Create DB ‘belongs_to’ and ‘has_many’
associations
. - Manually updating database schema file and all other associated files to add a new field to a database, then migrate to database.
- Editing controller to add
before_action
logic- created new function to prevent user editing other users data
Screenshots
Screenshot of the main table listing all the entries in the address book.
Screenshot of the form to create new entry.
Screenshot of the individual item page, plus showcasing the alert/notice messaging after successfully adding new person to address book.
Screenshot showing secure sign-in form.
Screenshot of the form to manage users account.
Screenshot showing sign out, redirect to index page and alert messaging .