Git Product home page Git Product logo

rails-cru-form_for-lab-houston-web-career-021819's Introduction

CRU with form_for Lab

Objectives

  1. Build RESTful actions for index, show, new, create, edit, update
  2. Use form_for for all forms (no need to share forms or partials)
  3. Correctly redirect when needed
  4. Interlink between pages using route helpers

Instructions

You've been tasked with building a Rails app called Beats by Rails, the app will need to have three separate models:

  • Songs

  • Artists

  • Genres

The data relationship will look something like this:

  • A song belongs to an artist

  • A song belongs to a genre

  • A genre has many songs

  • An artist has many songs

The tests are in the spec/features directory for each model. You will need to build in the ability to create, update, and show for each model. And for the song show page you need to have it display each of the song's genre and artist, and link to the respective genre and artist show pages.

The database tables should look like this (note each column type):

table "artists"
  string   "name"
  text     "bio"

table "genres"
  string   "name"

table "songs"
  string   "name"
  integer  "artist_id"
  integer  "genre_id"

Key notes to remember

  • You will need to use strong params

  • Don't worry about integrating drop down form elements for the genre and artist selections on the song form pages yet, simply enter in the ID in for each element

  • You can use the resource, model, migration, and controller generators, but do not use the scaffold generator Top Tip: Remember to use the --no-test-framework flag when generating models and controllers to avoid generating unnecessary testing frameworks!

View CRU with form_for Lab on Learn.co and start learning to code for free.

View CRU Rails Lab on Learn.co and start learning to code for free.

rails-cru-form_for-lab-houston-web-career-021819's People

Contributors

maxwellbenton avatar jordanhudgens avatar perpepajn25 avatar pletcher avatar danielseehausen avatar annjohn avatar curiositypaths avatar sgharms avatar octosteve avatar einarstensson avatar ipc103 avatar jmburges avatar agdavid avatar cjbrock avatar thebrianemory avatar victhevenot avatar

Watchers

Kevin McAlear avatar  avatar  avatar Belinda Black avatar Soundarya avatar Bernard Mordan avatar  avatar Joe Cardarelli avatar Sam Birk avatar Sara Tibbetts avatar The Learn Team avatar Sophie DeBenedetto avatar  avatar Jaichitra (JC) Balakrishnan avatar Antoin avatar Alex Griffith avatar  avatar Amanda D'Avria avatar  avatar Nicole Kroese  avatar  avatar Lore Dirick 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.