Displaying 2 results from an estimated 2 matches for "increment_rating".
2006 May 02
1
Newbie problem with Ajax and render partial
...;><%= link_to h (item.description), :action => ''show'',
:id => item %></td>
<td width="2%" align="right">
<%= link_to_remote (''+'', :update => ''rating_box'', :url =>{
:action => :increment_rating, :id => item.id})%>
</td>
</tr>
<tr height="60%">
<td width="98%"><%=h (truncate(item.text, 80)) %></td>
<td width="2%" align="right" id=''rating_box''>
<%= render (:...
2007 Jul 21
3
unable to get "has_many :after_add" to work - need help
Can someone tell me what I''m doing wrong? I''ve spent way too much
time on this
--------------------------------------------------------------------------------------
class Picture < ActiveRecord::Base
has_many :ratings, :after_add => :increment_rating, :after_remove
=> :decrement_rating
def increment_members(rating)
self.rating += rating.amount
save!
end
end
--------------------------------------------------------------------------------------
class Rating < ActiveRecord::Base
belongs_to :picture
end
----------------------...