Mon Dec 03 18:54:00 UTC 2007

Controller Partials in rails

Posted at 06:54 PM by matt

I've noticed lately that I reuse a lot of code between controllers, in some cases entire methods. What if you could do something like
def comment_posted
   <%= render :controller_partial => 'common/blog_posted' %>
end

Comments »

  1. Justin said,

    December 20th, 2007 at 05:37 AM

    You can... you just need to put the relative web URI of that resource/controller. <%= render :partial => '/admin/user/form' %> Something like that, you gotta play with it...

Leave a Comment