diff --git a/lib/asakusa_satellite/hook.rb b/lib/asakusa_satellite/hook.rb index 018a640f9..268a7bf63 100644 --- a/lib/asakusa_satellite/hook.rb +++ b/lib/asakusa_satellite/hook.rb @@ -50,9 +50,15 @@ def self.inherited(klass) super end + @@hooks = {} def self.render_on(hook, options={}) - define_method hook do |context| - context[:controller].send(:render_to_string, {:locals => context}.merge(options)) + if @@hooks[hook] + @@hooks[hook].push options + else + @@hooks[hook] = [options] + define_method hook do |context| + @@hooks[hook].map{|options| context[:controller].send(:render_to_string, {:locals => context}.merge(options))}.join("\n") + end end end