#110 new
David W. Body

P520 ff example code

Reported by David W. Body | February 3rd, 2008 @ 12:36 AM | in Second Edition

Several of the examples starting on p. 520 have class ItemController as a subclass of ActiveResource::Base instead of ActionController::Base.

Comments and changes to this ticket

  • Ricky Lui

    Ricky Lui February 7th, 2008 @ 06:34 PM

    also, I think the Item.find(:all, :conditions => {....

    should be replaced by:

    Item.find(:all, :params => ...

  • Ricky Lui

    Ricky Lui February 7th, 2008 @ 07:18 PM

    Oh... I think I'm mistaken. I think you're intending to show the ItemController on the local side (where Item is an ActiveRecord). Then on pg 521, you call Item.find(:all, :from => :used) on the remote side, where Item is an ActiveResource.

    Suggestion: for readers who are not very familiar with ActiveResources, maybe clarify which piece of code is local vs remote? e.g. say

    #pg 522

    class Item < ActiveRecord::Base

    ...

    end

    class ItemController < ...

    #pg 523

    class Item < ActiveResource::Base

    ...

    end

    >> used_item = Item.find(:all, :from => :used)

Please Login or create a free account to add a new comment.

You can update this ticket by sending an email to from your email client. (help)

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

People watching this ticket

Tags