Git Product home page Git Product logo

sinatra-jams's Introduction

๐ŸŽธJams ๐ŸŽธ

Welcome to your first day of work at Jams Incorporated. Today, you are tasked with creating an application that can keep track of all the musicians that Jams Inc. produces.

Jams Inc. works with tens and tens of artists, so keeping track of their name, age and bio is really important to the company.

Sinatra

Create & Read ๐Ÿ““

In keeping tradition with RESTful routes, Jams Inc. wants you to build out the following deliverables:

  • A database of Artists that will allow for a name string, age integer and bio string. If you created your database properly, you should be able to seed the database with the given seeds.rb file.

  • An index page that displays the names of all the artists in your database.

    • A nice to have feature: On the index page, clicking on the name of the artist would link me to their show page (see below).
  • A dynamically generated show page for a single artist that shows their name, age and bio.

  • A form to log a new artist with their name, age and bio. After the form is submitted, the user should be redirected to the saved artist's show page.

After you meet these deliverables, save and commit your code. Celebrate a little because you have now finished the CR part of your CRUD application. Yay! ๐Ÿ’ฏ

Update & Delete ๐Ÿ—‘

After a little celebration, your manager comes up to you and asks if you can implement some more features. Eager to make your application bigger and better, you say yes. Here are some more deliverables that your manager wants you to build out:

  • A dynamically generated edit-form for a single artist that is auto populated with the selected artist's information. After the edit-form is submitted, the site should redirect the user back to the show page, showing the new updated information.

    • A nice to have feature: On the artist's show page, have a link that will take the user to that artist's edit page.
  • A delete functionality that will be able to delete an artist from the database. This can be just a button on the artist's show page. When the button is clicked, the shown artist should be deleted and the webpage should be redirected to the index page of all the artists.

Save, commit and push your code! If you have met all these deliverables, you have accomplished CRUD for the Artist model, which is not an easy feat. Celebrate a little! ๐ŸŽ‰

After celebrating, you might want to consider using a separate Artist controller, if you have already not implemented it. As your application grows and you have more and more models in your domain, having separate controllers will help you follow the Single Responsibility Principle.

sinatra-jams's People

Contributors

hyeokjungkim avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.