This assessment should take around 5 hours complete.
- Rails 6
- Ruby 2.6.1
- Postgres 11
- Git Any
- You will need the following installed:
- Clone this repo
git clone https://github.com/simpleviewinc/zr-rails-test
- Install the gems
./bin/bundle exec install
- Setup the DB
bin/rails db:create && bin/rails db:migrate && bin/rails db:seed
- Get the project running
bin/bundle exec puma -C config/puma.rb
./run.sh
- Is a bash helper script to run the above commands optional- Requires a unix terminal will not work on windows
- Example =>
bash ./run.sh ...params
-
Setup the environment
- Use the commands listed in the
Installation
section above
- Use the commands listed in the
-
Open your browser to localhost:3000
- If running the project locally
-
The clean up the sites index page
- The page currently shows
List of sites / No Sites exist
and thePlease Login
sections.- Update the erb template so that
- The
Please Login
section shows ONLY when a user IS NOT logged in - The
List of sites
section shows ONLY when a user IS logged in
- The
- Update the erb template so that
- The page currently shows
-
The site index shows all sites
- Update the app so that it ONLY shows the logged in user's sites
-
Fix the
Delete
buttons- This should remove the site from the displayed sites list, WITHOUT reloading the window
- Clicking this button should delete the site from the database
-
Fix the
View
button- When clicking on the
View
button of a site card, the app throws an error - Add a new
show view template
- After clicking on the the
View
button, the app should navigate to the newshow view template
- When clicking on the
-
Build out the
show view template
created in the last step- The template should meet these requirements
- Show all attributes of a site
- Attributes should be editable
- Editing the attributes should be persistent
- Site attribute updates should NOT require reloading the window
- Show a list of pages linked to the site
- Each page should have
- A button or link to navigate to a
page show view template
- A button or link to remove to page from the page list
- This should remove the page from
page list
, WITHOUT reloading the window - this should be persistent
- This should remove the page from
- A button or link to navigate to a
- There should be a button or link to create a new page
- Clicking this action should display a form to input the details for a new page
- When saved the new page SHOULD be linked to the current site
- After it's created, the
page list
should update with the new page- This should NOT require reloading the window
- Each page should have
- Show all attributes of a site
- The template should meet these requirements
-
Build out the
page show view template
- Clicking on the link in the sites
page list
from above should navigate to this template - The template should meet these requirements
- Show all attributes of a page
- Attributes should be editable
- Editing the attributes should be persistent
- Page attribute updates should NOT require reloading the window
- Display the image attribute as an ACTUAL image, NOT just the image url
- Display the body content as ACTUAL html, not in a string format
- Show all attributes of a page
- Clicking on the link in the sites
-
Add a new migration
- The migration should meet these requirements
- Link a user to a page
- User should be added when the page is created
- For all previously created pages
- Find the linked site, add the sites user as the user for the page
- The migration should meet these requirements
-
Update the
page controller
index route- It should respond to different types of requests ( JSON && HTML )
- Add a view template that displays a list of pages created by the logged in user
- Add a button to the
_navbar.html.erb
template that navigates to this view template
- Add a button to the
-
Build out a page
index view template
for the page'sindex method
- Display only the pages of the logged in user
- The Page list should emulate the
page list
on the sitesshow view template
from step 7- The ONLY difference is that each page should include a link to it's parent site
- The link should navigate to the sites
show view template
- The link should navigate to the sites
- The ONLY difference is that each page should include a link to it's parent site
-
Add a search input at the top of the
page list
- The
page list
should update in real time as input is typed into the search input - The search should filter by name of the page
- It should filter out any non-matching pages in the
page list
- The
- Submit a pull request to this repo
- Send an us an email, letting us know it has been submitted
- Deploy the app to the cloud
- How this is done is not important. It just needs to be accessible via the internet
- Not every change required is outlined above. We want to see how you would do it
- Some tasks require updating multiple files for that task to be completed
- Don't be afraid to add, move, or change parts of the app. Show us what you can do
- Your are encouraged to show your work through comments
- You don't have to comment every little change, but we would like to see your thought process
- While css styles, look, and feel are not a priority, the app should look decent