Git Product home page Git Product logo

modification-nested-routes-lab-atx01-seng-ft-071320's Introduction

Modifying Nested Resources Lab

Objectives

  1. Implement nested resources for creation and modification

Overview

In this lab, we're going to be implementing nested resources for creating and editing songs through an artist.

Instructions

  1. Using nested resources, set up routes and controller actions to create new song records through an artist. Hint: Don't forget to update the strong parameters.
  2. Set up routes and controller actions to support editing a song as a nested resource of an artist.
  3. Create a helper to display a drop-down list of artists if someone edits a song directly via /songs/:id/edit and to only display the artist's name if they are editing through nested routing. Name the helper method artist_select. Hint: You'll need to set a variable in the controller action to pass to the helper method as an argument along with a song instance.
  4. Validate that new songs created for an artist via nested routing are created for valid artists, and redirect to /artists if not.
  5. Validate that songs being edited via nested routing have a valid artist. Redirect to /artists if not.
  6. Validate that songs being edited via nested routing are in the artist's songs collection. Redirect to /artists/:artist_id/songs if not.
  7. Make sure all tests pass!

modification-nested-routes-lab-atx01-seng-ft-071320's People

Contributors

maxwellbenton avatar dependabot[bot] avatar lizbur10 avatar scottcreynolds avatar ihollander avatar rrcobb avatar annjohn avatar blake41 avatar jmburges avatar sgharms avatar sdcrouse avatar

Watchers

Kaitlin Vignali avatar Mohawk Greene avatar Victoria Thevenot avatar Otha avatar raza jafri avatar  avatar Joe Cardarelli avatar The Learn Team avatar  avatar Ben Oren avatar Matt avatar Alex Griffith avatar  avatar Amanda D'Avria avatar  avatar Ahmed avatar Nicole Kroese  avatar Dominique De León avatar  avatar Lisa Jiang avatar Vicki Aubin avatar  avatar  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.