# Help needed with callbacks

**URL:** <https://www.ruby-forum.com/t/help-needed-with-callbacks/111775>\
**Category:** Rails\
**Created:** [August 10, 2007, 6:31pm UTC](https://www.ruby-forum.com/t/help-needed-with-callbacks/111775 "2007-08-10T18:31:07Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![cmaxvv](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/85f322/32.png) [@cmaxvv](https://www.ruby-forum.com/u/cmaxvv)\
**Post date:** [August 10, 2007, 6:31pm UTC](https://www.ruby-forum.com/t/help-needed-with-callbacks/111775/1 "2007-08-10T18:31:07Z")

</div>

I’m just delving into the world of callbacks and am stuck already…

I have Article, which has\_and\_belongs\_to\_many Links (and where a link is  
also an Article)

When the user tries to create a new article, i want to see if there’s  
already an article with that url. If there is, i want to call a method  
‘increase\_points’ on the article that exists already, and not add a new  
one.

In addition, if someone tries to add a link to an article, and the  
article already has that link, then i want to not add the link to  
article.links and return an error message.

Can anyone help me please?
