Oh, I forgot to mention i''m trying to get my ChrissMonster model to
pull
back the value of
"eat" in the chriss_monster table and increment the value by 1.
--Dan W.
Daniel Wozniak wrote:> Hi,
>
> Here''s my controller function:
>>>>
> def feed
> @chriss_monster = ChrissMonster.find(params[:id])
> @chriss_monster.feed
> redirect_to :action => ''list''
> end
> <<<
>
> Here''s my model:
>>>>
> class ChrissMonster < ActiveRecord::Base
> def feed
> ChrissMonster.increment_counter :eat, :id
> end
> end
> <<<
>
> When I call the controller function, it directs me back to the list
> page, it doesn''t give me an error, and it does NOT increment the
"eat"
> value.
>
> What am I doing wrong??
>
> Thanks for reading.
>
> --Dan W.
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk
-~----------~----~----~----~------~----~------~--~---