dewie
October 26, 2006, 12:38am
1
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.
dewie
October 26, 2006, 1:29am
2
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.