Please, explain what you're doing exactly (eg. post the code of your hook class, or at least give the hook name). Using <% content_for :header_tags do %> in a plugin view actually works as expected.
require 'redmine'
class Hooks < Redmine::Hook::ViewListener
render_on :view_issues_show_details_bottom, :partial => 'assets', :layout => false
end
Redmine::Plugin.register :issue_hot_buttons do
name 'Issue Hot Buttons Plugin'
author 'Mike Kolganov, Thumbtack Inc.'
description 'Plugin for Redmine that add buttons for often used actions to issue page'
version '0.4.1'
url 'https://github.com/mikekolganov/redmine-issue-hot-buttons'
end
app/views/issues/_assets.html.erb content is:
<% content_for :header_tags do %>
<%= javascript_include_tag 'hot_buttons.js', :plugin => 'issue_hot_buttons' %>
<%= stylesheet_link_tag 'hot_buttons.css', :plugin => 'issue_hot_buttons' %>
<% end %>
Test Test Test!
If I open any issue, I see "Test Test Test!", but links to "hot_buttons.js" and "hot_buttons.css" are absent.
If I modify code in app/views/issues/_assets.html.erb:
Subject changed from Mechanism <% content_for :header_tags do %> doesn't work inside hook to <% content_for :header_tags do %> doesn't work inside hook