aromalsanthosh / Rails-Hiring-Task

Culture Monkey Ruby On Rails Developer Hiring Assignment Submission

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Rails Developer - Hiring Task

Task Description

  1. Create a new Rails application

  2. Create 2 models Employee (first_name, last_name, email_address, phone, salary) and Department (name)

  3. Display a HTML table to list all employees and their data as below

enter image description here

  1. Add new column to this table to edit department

enter image description here

 Display a HTML table to list all employees and their data as below

  1. Edit Departmentshould open a modal that lists all available departments in a drop

down. User should be able to select a department from the drop down and update

the employee's department.

enter image description here

The project is built with :

  • Ruby version : Ruby 2.6.0

  • Rails version : Rails 5.2.8.1

To set up the development database for a Rails application, you can include the following instructions in your README file:

Setting up the The Project

Follow these steps to set up the development database for the Rails application:

  1. Make sure you have Ruby and Rails installed on your system. You can check this by running the following commands in your terminal:

  

ruby --version

  

rails --version

  

  1. Install the required dependencies by running the following command in the root directory of your Rails application:

  

bundle install

  

  1. Configure the database connection in the config/database.yml file. This file contains the database configuration for different environments. Make sure the development section in the file has the correct settings for your database. For example:
  

development:

  

adapter:  mysql2

  

database:  your_database_name

  

username:  your_username

  

password:  your_password

  

host:  localhost

  

port:  3306

  
  1. Create the development database by running the following command in your terminal:

  

rails db:create

  

  1. Run database migrations to set up the required tables by executing the following command:

  

rails db:migrate

  

  1. (Optional) If you need to seed the development database with sample data, you can create a db/seeds.rb file and populate it with the necessary data. Then run the following command to seed the database:

  

rails db:seed

  

  1. Start the Rails development server by running the following command:

  

rails server

  

  1. Access the application in your web browser by visiting http://localhost:3000/employees. You should now be able to interact with your Rails application using the development database.

Note: Make sure to replace your_database_name, your_username, and your_password with the actual values for your database configuration.

Screenshots

  • http://localhost:3000/employees

enter image description here

  • Update Department page

  • enter image description here

  • Showing User Info After Edit

enter image description here

About

Culture Monkey Ruby On Rails Developer Hiring Assignment Submission


Languages

Language:Ruby 70.6%Language:HTML 24.4%Language:JavaScript 2.5%Language:CSS 1.5%Language:CoffeeScript 0.5%Language:SCSS 0.4%