Rails Decal

Lecture 4 - Index, Show, New, Create

Logistics

So I messed up

  • Resubmit HW 1 and 2
    • Your commits have a timestamp
  • Extension on HW 3
  • Always Backup your Production DB

Live Demo Heavy

Homework should contain all code

CRUD

  • Create
  • Read
  • Update
  • Destroy

Index

  • Endpoint to create resource.  It is where the request gets sent.

Show

  • Detail view of a particular resource

New

  • Page to create new resource

Create

  • A list of all the entries in the database table

Keep to resourceful routes!

Allows Rails to infer functionality

Strong Parameters

  • Security Purposes
  • Select certain key value pairs from your params hash
  • Covered in live demo

form_for

  • pass a model as an argument
  • will infer route and method based on model passed
  • sends form information scoped under model name

Paths

Convenient URL's in Ruby

Can see by running: rake routes

Live Coding

Fall 2016 - Week 4: Index, Show, New, Create

By Rails Decal

Fall 2016 - Week 4: Index, Show, New, Create

  • 1,038