On 10/26/06, Ruben D. Orduz <aminox / gmail.com> wrote:
> Dan,
>
> Your schema/model need work. What you need to do is retrieve the value of
> eat that corresponds with the param[:id] increment it (within your code [eat
> += 1;]), and then store it back to the DB.

I thought something along these lines also, but looking at the
documentation for increment_all
http://rubyonrails.org/api/classes/ActiveRecord/Base.html#M000871

and following the source code looks like it will run a SQL query something like

    UPDATE ChrissMonsters SET eat = eat + 1 WHERE id = self_id;

where self_id is the id of the particular instance.  Notice that
increment_all is a class method of ActiveRecord::Base

So it SHOULD act like

   self.increment_counter(:eat)

Not sure why it doesn't seem to be.
-- 
Rick DeNatale

My blog on Ruby
http://talklikeaduck.denhaven2.com/