Worldofresources
Upcoming SlideShare
Loading in...5
×
 

Worldofresources

on

  • 1,540 views

 

Statistics

Views

Total Views
1,540
Views on SlideShare
1,540
Embed Views
0

Actions

Likes
2
Downloads
44
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Worldofresources Worldofresources Presentation Transcript

  • Discovering a world of Resources on Rails David Heinemeier Hansson
  • Create Read Update Delete
  • What they told you... Simplistic Unfulfilling Unworthy Shameful
  • They were wrong
  • How I learned to stop worrying and love the CRUD
  • find create update destroy SELECT INSERT UPDATE DELETE
  • GET POST PUT DELETE find create update destroy SELECT INSERT UPDATE DELETE
  • POST /people/create GET /people/show/1 POST /people/update/1 POST /people/destroy/1
  • POST /people GET /people/1 PUT /people/1 DELETE /people/1
  • Why bother? Consistency Simplicity Discoverability
  • Constraints are liberating (a straight jacket for your mind)
  • Model beyond “things” Relations (membership, subscription) Events (closure, change) States (reviewed, accepted)
  • But!
  • CRUD is not a goal, it’s an aspiration, a design technique
  • POST /kases/1;close /identity;aspect GET /kases/1;edit /identity;view
  • And there is more!
  • Answering to mime types One controller for many clients One action returning different results Flexible input model
  • One more thing
  • Active Resource
  • www.rubyonrails.org