# Creating similar but non-identical pages?

**URL:** <https://www.ruby-forum.com/t/creating-similar-but-non-identical-pages/190941>\
**Category:** Rails\
**Created:** [July 1, 2010, 11:01am UTC](https://www.ruby-forum.com/t/creating-similar-but-non-identical-pages/190941 "2010-07-01T11:01:31Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Isak](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/ac91a4/32.png) [@Isak](https://www.ruby-forum.com/u/Isak)\
**Post date:** [July 1, 2010, 11:01am UTC](https://www.ruby-forum.com/t/creating-similar-but-non-identical-pages/190941/1 "2010-07-01T11:01:31Z")

</div>

Our app has two user models, User and Admin, each with their own non-  
overlapping UI.

Users have a reasonably simple crud page, let’s call it “foods”, and  
we want to add “foods template” functionality to the admin ui.  
Basically reusing the food model, but with a blank user\_id FK, as  
default data for new users.

What is the best way to go about this and not duplicate model,  
controllers and views…?

We’ve considered extracting common controller code into a module and  
mixing that into two separate controllers, but would still have to  
duplicate the views for that – or at least sprinkle them with  
permission checks for every link.

Using a single controller/view sprinkled with “mode” checks doesn’t  
feel right either, but could work with some work on our authorization  
code.

Any other suggestions?
