# How to write acts\_as style model extensions?

**URL:** <https://www.ruby-forum.com/t/how-to-write-acts-as-style-model-extensions/129438>\
**Category:** Rails\
**Created:** [February 18, 2008, 4:47pm UTC](https://www.ruby-forum.com/t/how-to-write-acts-as-style-model-extensions/129438 "2008-02-18T16:47:28Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![johnlester](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e480ec/32.png) [@johnlester](https://www.ruby-forum.com/u/johnlester)\
**Post date:** [February 18, 2008, 4:47pm UTC](https://www.ruby-forum.com/t/how-to-write-acts-as-style-model-extensions/129438/1 "2008-02-18T16:47:28Z")

</div>

Hi, I want to have a go at writing an extension to my models, in a  
similar style to those acts\_as model extensions. I want to have a sigle  
declaration that includes my functionality, similar to  
“acts\_as\_taggable” and then specify callbacks in a similar way to  
“before\_filter” that my extended functionality will call. Something  
like:-

Class Item \< ActiveRecord  
acts\_as\_widget  
widget\_work\_filter :do\_widget\_work

def do\_widget\_work  
…  
end

end

Is there a good resource you can point me at that will explain how to do  
this…?
