app/helpers/governor_helper.rb in governor-0.1.1 vs app/helpers/governor_helper.rb in governor-0.2.0

- old
+ new

@@ -1,14 +1,18 @@ module GovernorHelper @@months = %w(January February March April May June July August September October November December) + Governor::PluginManager.plugins.map{|p| p.helpers }.flatten.each do |mod| + include mod.constantize # FIXME this feels pretty dirty, there has to be a better way + end + def render_plugin_partial(where, options = {}) - output = "" - Governor::PluginManager.view_hooks[where].each do |f| - opts = options.merge( {:file => f} ) + output = '' + Governor::PluginManager.plugins.map{|p| p.partial_for(where) }.compact.each do |partial| + opts = options.merge( {:partial => "governor/#{partial}"} ) output << render(opts) end - return output + return output.html_safe end def get_date_label if not params[:day].nil? "#{@@months[params[:month].to_i - 1]} #{params[:day]}, #{params[:year]}"