define a helper to do a partial render

I have a helper module (actually in a plugin) and I have this:

def partial_layer_select
   args = {:partial => 'map/select_layer',
            :locals => {:layers => @layers, :cur_layer =>
@cur_layer }}
   return args
end

so that in my view I do

<%= render partial_layer_select %>

but I'd rather call render in the helper in a caller context which it
seems like maybe there is a way to do that ?

The reason I need to do this is that I used helper_method to allow the
controller methods to be used in the view, but then a in a controller
a partial render is considered a render and only allowed once I guess.

In my plugin I did this, in effect I would like to extend
ApplicationHelper, but I was not sure the best way to go about it and
had been reading this:
http://railspikes.com/2008/8/22/how-to-fix-your-rails-helpers

module GeoCtlInst

def partial_layer_select
   args = {:partial => 'map/select_layer',
            :locals => {:layers => @layers, :cur_layer =>
@cur_layer }}
   return args
end

end

class ActionController::Base
include GeoCtlInst

helper_method :partial_layer_select

end

Sorry to “bounce” you but this list is for Ruby on Rails core issues. For Ruby on Rails help, go to the rubyonrails-talk mailing list.

Thanks!