From a4458d702c41a5b609f56ed10e4076d9c84ba181 Mon Sep 17 00:00:00 2001 From: Braulio Bhavamitra Date: Mon, 14 Apr 2014 16:20:24 -0300 Subject: [PATCH] Use instance_eval instead of content.call on plugins' dispatch --- app/views/layouts/application-ng.rhtml | 8 ++++---- app/views/profile_editor/edit.rhtml | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/views/layouts/application-ng.rhtml b/app/views/layouts/application-ng.rhtml index d058227..6da58c2 100644 --- a/app/views/layouts/application-ng.rhtml +++ b/app/views/layouts/application-ng.rhtml @@ -34,8 +34,8 @@ <%# Add custom tags/styles/etc via content_for %> <%= yield :head %> <%= - @plugins.dispatch(:head_ending).collect do |content| - content.respond_to?(:call) ? content.call : content + @plugins.dispatch(:head_ending).map do |content| + if content.respond_to?(:call) then instance_eval(&content).html_safe else content.html_safe end end.join("\n") %> @@ -47,8 +47,8 @@ <%= _("Go to the content") %> <%= - @plugins.dispatch(:body_beginning).collect do |content| - content.respond_to?(:call) ? content.call : content + @plugins.dispatch(:body_beginning).map do |content| + if content.respond_to?(:call) then instance_eval(&content).html_safe else content.html_safe end end.join("\n") %> diff --git a/app/views/profile_editor/edit.rhtml b/app/views/profile_editor/edit.rhtml index 5a074bd..a9025c8 100644 --- a/app/views/profile_editor/edit.rhtml +++ b/app/views/profile_editor/edit.rhtml @@ -52,8 +52,8 @@ )%> <%= - @plugins.dispatch(:profile_editor_extras).each do |content| - content.respond_to?(:call) ? content.call : content + @plugins.dispatch(:profile_editor_extras).map do |content| + if content.respond_to?(:call) then instance_eval(&content).html_safe else content.html_safe end end.join("\n") %> -- libgit2 0.21.2