# What to use in place of components using a "static" controller

**URL:** <https://www.ruby-forum.com/t/what-to-use-in-place-of-components-using-a-static-controller/127933>\
**Category:** Rails\
**Created:** [February 2, 2008, 9:01pm UTC](https://www.ruby-forum.com/t/what-to-use-in-place-of-components-using-a-static-controller/127933 "2008-02-02T21:01:55Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![thom](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/57b2e6/32.png) [@thom](https://www.ruby-forum.com/u/thom)\
**Post date:** [February 2, 2008, 9:01pm UTC](https://www.ruby-forum.com/t/what-to-use-in-place-of-components-using-a-static-controller/127933/1 "2008-02-02T21:01:55Z")

</div>

I’m working on a site that has a lot of static and semi-static pages.  
I’m using a StaticController to keep everything DRY and allow for erb  
code in the pages when necessary:

class StaticController \< ApplicationController

def display\_page  
begin  
render(:template =\> “static/#{params[:path].join(’/’)}”)  
rescue  
render(:template =\> “static/404”, :status =\> 404)  
end  
end

def index  
render(:template =\> “static/home”)  
end

end

Some of these pages contain components (such as a news feed), which  
I’ve been assured are Not A Good Thing. Instead, I’ve been told to use  
partials and :before\_filter to get the same results. However, in this  
case, a :before\_filter is not an option because there is only one  
action to render all static pages. The only alternative seems to be  
grabbing the data in the partial itself, which does not seem to be  
proper separation. What should I do?
