# Render :action for moved templates

**URL:** <https://www.ruby-forum.com/t/render-action-for-moved-templates/113888>\
**Category:** Rails\
**Created:** [September 5, 2007, 10:44pm UTC](https://www.ruby-forum.com/t/render-action-for-moved-templates/113888 "2007-09-05T22:44:12Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![sjf\_control](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/c68b51/32.png) [@sjf\_control](https://www.ruby-forum.com/u/sjf_control)\
**Post date:** [September 5, 2007, 10:44pm UTC](https://www.ruby-forum.com/t/render-action-for-moved-templates/113888/1 "2007-09-05T22:44:12Z")

</div>

I have two actions, that I want to use the same template. However, the  
template is stored in a non-stardard location (a subdirectory under  
views/). My original code looked like:

def edit\_member  
  
render :template =\> “path/to/template/edit\_member”  
end

def add\_member  
  
render :action =\> :edit\_member  
end

The intent here is that add\_member is a special case of edit\_member.  
Edit\_member points to its template (an .rjs file), and add\_member  
points to edit\_member to pick up the same template

Unfortunately, add\_member does not find the template. Apparently it  
tries to find where the default template would be stored for  
edit\_member (app/views//edit\_member.???)

Obviously, I could repeate the render :template line in add\_member,  
but would prefer to only list the path/template name once. Is there  
some way to do this? Or some way to have the templates for each  
action listed external to the action definition?

The documentation doesn’t describe what “render :action” does very  
well. Just “renders the template for the action”, which is something  
of a circular definition.

Thanks,  
sjf
