# Create acts\_as\_xxx for a controller?

**URL:** <https://www.ruby-forum.com/t/create-acts-as-xxx-for-a-controller/119292>\
**Category:** Rails\
**Created:** [November 5, 2007, 9:23pm UTC](https://www.ruby-forum.com/t/create-acts-as-xxx-for-a-controller/119292 "2007-11-05T21:23:22Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![josh](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/45deac/32.png) [@josh](https://www.ruby-forum.com/u/josh)\
**Post date:** [November 5, 2007, 9:23pm UTC](https://www.ruby-forum.com/t/create-acts-as-xxx-for-a-controller/119292/1 "2007-11-05T21:23:22Z")

</div>

Hi all

I have created quite a useful module:

ActsAsManager  
def new  
…  
end

def edit  
…  
end  
…  
end

that adds methods to a controller to do all the CRUD stuff in a very  
dynamic way.

So far I just added an include ActsAsManager to every controller that  
needed it. But now that’s not enough anymore, because I need some  
controllers to add only e.g. the “edit” method etc. What’s the most  
conform way to do that?

I thought about something like that:

class Admin::CountriesController \< Admin::ApplicationController  
acts\_as\_manager :except =\> :destroy  
end

or

class MemberController \< ApplicationController  
acts\_as\_manager :only =\> [:show, :edit]  
end

But how can I do that? I’m not very familiar with dynamic class  
extension…

Thanks a lot for input,  
Josh
