def show
@post = Post.find(params[:id])
@post.increment_count
if @post.save
render :action => ''show''
else
flash[:notice] = ''Error''
end
end
def increment_count
unless self.count.nil?
self.count += 1
else
self.count = 1
end
end
The count is not updated? and it is showing Error (flash notice)
Please help
--
Posted via 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
groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---