Episode 5 - The REST of Brand

Vlcsnap-2009-09-17-17h20m15s107

Click on image above for a preview

Released: Sep 17, 2009, Running time: 51 min

In this episode:

Finishing out the remaining RESTful actions – edit, update and destroy – for the Brand resource.

Tags: rspec, cucumber, git, controller, model

Add to cart$5.00
  • Share

We created the Brand model and added the new action in Episode 3 and the create action in Episode 4.

In this episode we add the edit, update and destroy actions to the BrandsController following the red-green cycle, finishing the Brand resource.

For easier specifying of our Brand model, we use the remarkable_rails gem. It provides you with a nice DSL for specifying columns, associations and even validations for your model.

Screenshots

  • Vlcsnap-2009-09-17-17h50m24s16
  • Vlcsnap-2009-09-17-17h52m55s243
  • Vlcsnap-2009-09-17-17h54m30s159
  • Vlcsnap-2009-09-17-17h55m08s24
  • Vlcsnap-2009-09-17-17h55m08s24
  • Vlcsnap-2009-09-17-17h56m06s106
  • Vlcsnap-2009-09-17-17h56m33s123

2 comments

Why don’t you guys use “#all” method instead of "#find(:all)? Just writing “all” saves a little time.

In reply to takaaki

Why don’t you guys use “#all” method instead of "#find(:all)? Just writing “all” saves a little time.

Just a habit really, from the days when we did not have named scopes.

Using “all” instead of “find(:all)” would also make it easier to spec, in addition to saving some keystrokes.

Commenting is disabled.