# Rendering different view for different referrer for same action

**URL:** <https://www.ruby-forum.com/t/rendering-different-view-for-different-referrer-for-same-action/183532>\
**Category:** Rails\
**Created:** [February 16, 2010, 6:38am UTC](https://www.ruby-forum.com/t/rendering-different-view-for-different-referrer-for-same-action/183532 "2010-02-16T06:38:38Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![samiron](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/ac91a4/32.png) [@samiron](https://www.ruby-forum.com/u/samiron)\
**Post date:** [February 16, 2010, 6:38am UTC](https://www.ruby-forum.com/t/rendering-different-view-for-different-referrer-for-same-action/183532/1 "2010-02-16T06:38:38Z")

</div>

I was wondering about a design pattern. Let me give you a example.  
Say, in a application there are users and three ways to see users.

1. User list
2. A single user description
3. User with his/her associated group (assume every user must belong  
to one or more group)

Now everywhere I have a edit link to update the user’s information.  
Clicking the link will open a popup where I can change the information  
and save. So at save action of users\_controller, we need three kind of  
rendering for above three referrers.

In these situations, what you guys do? is there any built-in support  
in rails to handle these situations? or we need to put lots of  
if…else in save.rjs file?  
Thank you
