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 ? -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en.
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 On Jan 28, 2:27 pm, Jedrin <jrubia...@gmail.com> wrote:> 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 ?-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en.
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! 2010/1/29 Jedrin <jrubiando@gmail.com>> 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 > > > On Jan 28, 2:27 pm, Jedrin <jrubia...@gmail.com> wrote: > > 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 ? > > -- > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Core" group. > To post to this group, send email to rubyonrails-core@googlegroups.com. > To unsubscribe from this group, send email to > rubyonrails-core+unsubscribe@googlegroups.com<rubyonrails-core%2Bunsubscribe@googlegroups.com> > . > For more options, visit this group at > http://groups.google.com/group/rubyonrails-core?hl=en. > >-- Ryan Bigg -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en.