Git Product home page Git Product logo

forms-and-basic-associations-rails-lab-notredame-se-ds-preview's Introduction

Forms And Basic Associations Rails Lab

Objectives

  1. Practice building associations
  2. Practice building forms in erb

A song library

In this lab, we're going to make a song library. Our data model looks like this:

  • Artist
    • has a name (string)
    • has many songs
  • Song
    • has a title (string)
    • belongs to an Artist
    • belongs to a Genre
  • Genre
    • has a name (string)
    • has many songs
  • Note
    • has content (string)
    • belongs to a Song

Instructions

The base models, controllers, and seed data have been provided for you, but the associations have not been wired up. Artists and genres have many songs. Songs belong to both and have many notes. Notes belong to songs.

  • Write app/views/songs/new.html.erb. This form should have:
    • A text input box that sets the song's title.
    • A text input box for the artist.
    • A selection box for genre. Users should be able to pick amongst existing genres only.
    • Several text input boxes to add notes to the song. These should have the IDs song_notes_1, song_notes_2, and so on for the specs to pass. (You might need to search around for how to pass an array using strong_params!) There are feature tests!

View Forms And Basic Associations Rails Lab on Learn.co and start learning to code for free.

forms-and-basic-associations-rails-lab-notredame-se-ds-preview's People

Contributors

queerviolet avatar maxwellbenton avatar ipc103 avatar pletcher avatar danielseehausen avatar mendelb avatar annjohn avatar genericlady avatar jmburges avatar aviflombaum avatar lkwlala avatar

Watchers

James Cloos avatar Kevin McAlear avatar  avatar Mohawk Greene avatar Victoria Thevenot avatar Yoan Ante avatar Belinda Black avatar Bernard Mordan avatar raza jafri avatar  avatar Joe Cardarelli avatar The Learn Team avatar Sophie DeBenedetto avatar  avatar Antoin avatar Alex Griffith avatar  avatar Amanda D'Avria avatar  avatar Nicole Kroese  avatar Kaeland Chatman avatar Lisa Jiang avatar Vicki Aubin avatar  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.