Git Product home page Git Product logo

namespaced-routes-lab-den01-seng-ft-080320's Introduction

Namespaced Routes Lab

Objectives

  1. Organize controllers using a module.
  2. Use namespaced routes.

Overview

We're going to add some administrative functions to our song library. Using what we learned about namespaced routes and module scope, we'll organize our controllers and routes under an admin namespace to keep them separate from the regular user functions.

Instructions

The base application has been provided with tests. Make sure to run rake db:seed to set up seed data. Tests can be run with rspec.

Note: Since we're building new features on an existing project that already has tests, part of the job is to make sure the tests that already pass at the beginning still pass when you're done!

  1. Create a Preference model that will store preferences for the app. It will need to have fields for:
    • Allowing creation of new songs. Used to control the ability to add new songs to the system.
    • Allowing creation of new artists. Used to control the ability to add new artists to the system. Note: There will only be 1 instance of Preference, not a preference associated with each artist/song. After creating the model, run rake preferences:load so that your code will work in the browser.
  2. Create a PreferencesController, routes, and views. Do this under an Admin module to separate it from the standard user functionality.
  3. Update the songs#new and artists#new actions to check that creating new songs or artists is enabled, and redirect to /songs and /artists, respectively, if that preference is disabled.
  4. Make sure tests pass.

Happy Gilmore

namespaced-routes-lab-den01-seng-ft-080320's People

Contributors

maxwellbenton avatar scottcreynolds avatar lizbur10 avatar dependabot[bot] avatar drakeltheryuujin avatar dakotalmartinez avatar jmburges avatar sgharms avatar rrcobb avatar annjohn avatar blake41 avatar pletcher avatar gj avatar

Watchers

Kaitlin Vignali avatar  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.