Thom
2008-Feb-02 20:00 UTC
What to use in place of components using a "static" controller.
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? --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---