# Design question

**URL:** <https://www.ruby-forum.com/t/design-question/79705>\
**Category:** Rails\
**Created:** [March 10, 2006, 10:24pm UTC](https://www.ruby-forum.com/t/design-question/79705 "2006-03-10T22:24:51Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![david](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/aeb1de/32.png) [@david](https://www.ruby-forum.com/u/david)\
**Post date:** [March 10, 2006, 10:24pm UTC](https://www.ruby-forum.com/t/design-question/79705/1 "2006-03-10T22:24:51Z")

</div>

Where would people put the actions for the following scenario? I have  
three models: users, messages and permissions. Certain users can see  
certain messages that are left, thanks to the permissions table (which  
simply links user\_id to message\_id).

I currently have three controllers:

Login: login, logout, add\_user (etc)  
Messages: for the users  
Admin: for the administrator, add\_message, edit\_message (etc)

Maybe the user functions should be moved into the AdminController?  
Maybe I’m way off here? It seems that controllers should lump together  
groups of functionality, but they could end up huge.

In the future I might add groups (which will require add\_group, adding  
users to groups for the administrator). Is this really best in the  
Admin controller? I can see it getting very unwieldy.

The pragmatic book keeps things in two controllers, one for the “user”  
tasks and one for the “admin” tasks. I’ve tried keeping it like that  
for my application, but it seems like I could end up with one controller  
per model almost, which seems wrong for many reasons (e.g. views are  
actually common to them all).

Any advice on how to begin thinking about this would be greatly  
appreciated.
