Rails Decal

Lecture 4 - Index, Show, New, Create

Logistics

Live Demo Heavy

Homework should contain all code

CRUD

  • Create
  • Read
  • Update
  • Destroy

Index

  • Endpoint to create resource

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 2015 - Week 4: Index, Show, New, Create

By Rails Decal

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

  • 1,103