Commit 3f24e889eb823cca9d7fe3c900bc09e4ff7ef56a

Authored by Rodrigo Souto
1 parent 6c1289d2

Putting expanded_template back

  * This method is useful for plugins that needs to render pages but do
    not have access to the render method in the place the hotspot is
    called.

(ActionItem2096)
Showing 1 changed file with 5 additions and 0 deletions   Show diff stats
lib/noosfero/plugin.rb
... ... @@ -65,6 +65,11 @@ class Noosfero::Plugin
65 65 end
66 66 end
67 67  
  68 + def expanded_template(file_path, locals = {})
  69 + views_path = "#{RAILS_ROOT}/plugins/#{self.class.public_name}/views"
  70 + ERB.new(File.read("#{views_path}/#{file_path}")).result(binding)
  71 + end
  72 +
68 73 # Here the developer may specify the events to which the plugins can
69 74 # register and must return true or false. The default value must be false.
70 75  
... ...