Skip to content

Commit

Permalink
use :assigns instead of @-starting keys in :locals in render_to_string
Browse files Browse the repository at this point in the history
  • Loading branch information
cat-in-136 committed Aug 3, 2024
1 parent 59f151e commit a978fbe
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions lib/redmine_hearts/view_hook.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ def view_layouts_base_html_head(context={})
if subject
controller.send(:render_to_string, {
:partial => "hooks/redmine_hearts/view_layouts_base_html_head",
:locals => context.merge(:@heartable => subject)
:locals => context,
:assigns => { :heartable => subject }
})
end
end
Expand All @@ -36,7 +37,8 @@ def view_layouts_base_content(context={})
if subject
controller.send(:render_to_string, {
:partial => "hooks/redmine_hearts/view_layouts_base_content",
:locals => context.merge(:@heartable => subject)
:locals => context,
:assigns => { :heartable => subject }
})
end
end
Expand All @@ -47,7 +49,8 @@ def view_account_left_bottom(context={})
controller = context[:controller]
controller.send(:render_to_string, {
:partial => "hooks/redmine_hearts/view_account_left_bottom",
:locals => context.merge(:@heart_count => heart_count)
:locals => context,
:assigns => { :heart_count => heart_count }
})
end
end
Expand Down

0 comments on commit a978fbe

Please sign in to comment.