Displaying 1 result from an estimated 1 matches for "chrissmonst".
Did you mean:
chrissmonster
2006 Oct 25
1
how to use increment_counter in model
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 contr...