GithubHelp home page GithubHelp logo

noelanimanini / crud-with-validations-lab Goto Github PK

View Code? Open in Web Editor NEW

This project forked from learn-co-curriculum/crud-with-validations-lab

0.0 0.0 0.0 93 KB

License: Other

Ruby 83.42% CSS 1.57% HTML 13.04% JavaScript 1.60% SCSS 0.36%

crud-with-validations-lab's Introduction

CRUD With Validations Lab

Introduction

Your goal in this lab is to create a thorough CRUD interface for one model, the Song.

Songs

Songs have the following attributes and limitations:

  • title, a string
    • Must not be blank
    • Cannot be repeated by the same artist in the same year
  • released, a boolean describing whether the song was ever officially released
    • Must be true or false
  • release_year, an integer
    • Optional if released is false
    • Must not be blank if released is true
    • Must be less than or equal to the current year
  • artist_name, a string
    • Must not be blank
  • genre, a string

Requirements

Use the resource generator, not the scaffold generator

X 1. Define a model with validations for Song.

X 2. Define all RESTful routes for songs.

X 3. Render the list of songs in an HTML table.

X 4. Build views that connect to each other using route helpers.

X 5. Use form_for to build forms with pre-fill and error list features. (Hint: Try using a partial to cut down on copy/pasting!)

  1. Allow deleting songs with a link, using link_to. Check out the official documentation for additional info including setting the method: to :delete.

  2. Use strong parameters in your POST/PATCH controller actions.

  3. Set the root route to the song index.

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.