# Consolidating Controllers and Models

**URL:** <https://www.ruby-forum.com/t/consolidating-controllers-and-models/169898>\
**Category:** Rails\
**Created:** [June 10, 2009, 3:14am UTC](https://www.ruby-forum.com/t/consolidating-controllers-and-models/169898 "2009-06-10T03:14:05Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![djames](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/7ab992/32.png) [@djames](https://www.ruby-forum.com/u/djames)\
**Post date:** [June 10, 2009, 3:14am UTC](https://www.ruby-forum.com/t/consolidating-controllers-and-models/169898/1 "2009-06-10T03:14:05Z")

</div>

I have created a sample blog following the guidance provided in the  
related Rails screencast. As a standalone application, it works  
great. However, for integrating with other things I really don’t like  
having 2 controller/model pairs named ‘post’ and ‘comment’  
respectively. The names are too generic and may conflict with other  
things that I want to do. Of course, the obvious solution is to  
simply use other names such as ‘blog\_post’ and ‘blog\_comment’ and  
maybe that’s the best thing to do. However, it occurs to me that the  
‘comment’ controller has only one very small ‘create’ method in it  
which I think could easily be consolidated with the contents of the  
‘post’ controller into a single ‘blog’ controller. I’d like to do  
something similar with the with the 2 model classes; but, I think  
that’s going to be a much taller order. If I could somehow wind up  
with the model classes being addressable as something like blog.post  
and blog.comment that’s probably what I would have in mind but I don’t  
know how to do it and I’m not sure that it’s worth the effort.

Anyway, my question is this: Is this something I should pursue mostly  
as an academic exercise; or, should I just forget about it? If I  
should pursue it, are there suggestions on the best way to deal with  
the models?

Thanks for any input.

```
      ... doug
```
