DRY - with modules, render_component or.. ?

The components route was tried but apparently had negative performance
attributes. For this and probably other reasons, Rails Core is not
advocating use of components. However, plugins will fill the same bill.

Any extension you make to ActionController in your plugin will be seen by
all controllers, and it sounds like that's the only place where you need to
make changes. The one additional wrinkle is where the template goes. I
recommend putting the template in the plugin tree as well in a views
directory, then changing telling Rails where to find the correct view. You
do that by changing template_root in earlier versions of Rails and by
calling class function prepend_view_path in edge. Here's an example
(untested, sorry):

class ActionController
  prepend_view_path "#{RAILS_ROOT}/vendor/plugins/my_plugin/lib/app/views"

  def new_order
    @order = Order.new # should look for template in your
plugin/lib/app/views directory
  end

  # etc.
end

Hope this helps.

Mike-293 wrote: