https://www.redmine.org/https://www.redmine.org/favicon.ico?16793021292012-06-07T04:20:52ZRedmineRedmine - Defect #11105: <% content_for :header_tags do %> doesn't work inside hookhttps://www.redmine.org/issues/11105?journal_id=387852012-06-07T04:20:52ZVladimir Pitin
<ul></ul><p>If I insert code:</p>
<pre>
<% content_for :header_tags do %>
<%= stylesheet_link_tag :issue_hot_buttons_sidebar, :plugin => 'issue_hot_buttons_plugin' %>
<% end %>
</pre>
<p>in redmine view near hook, it work fine, but in the hook It doesn't work.</p> Redmine - Defect #11105: <% content_for :header_tags do %> doesn't work inside hookhttps://www.redmine.org/issues/11105?journal_id=388062012-06-07T17:16:10ZJean-Philippe Langjp_lang@yahoo.fr
<ul><li><strong>Resolution</strong> set to <i>Cant reproduce</i></li></ul><p>Please, explain what you're doing exactly (eg. post the code of your hook class, or at least give the hook name).<br />Using <code><% content_for :header_tags do %></code> in a plugin view actually works as expected.</p> Redmine - Defect #11105: <% content_for :header_tags do %> doesn't work inside hookhttps://www.redmine.org/issues/11105?journal_id=388152012-06-07T22:28:14ZVladimir Pitin
<ul></ul><p>For example. init.rb code:</p>
<pre>
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
</pre>
<p>app/views/issues/_assets.html.erb content is:</p>
<pre>
<% 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!
</pre>
<p>If I open any issue, I see "Test Test Test!", but links to "hot_buttons.js" and "hot_buttons.css" are absent.</p>
<p>If I modify code in app/views/issues/_assets.html.erb:</p>
<pre>
<%= javascript_include_tag 'hot_buttons.js', :plugin => 'issue_hot_buttons' %>
<%= stylesheet_link_tag 'hot_buttons.css', :plugin => 'issue_hot_buttons' %>
</pre>
<p>Links appear inside tag "body":<br /><pre>
<link href="/plugin_assets/issue_hot_buttons/stylesheets/hot_buttons.css?1339038118" media="screen" rel="stylesheet" type="text/css">
<script src="/plugin_assets/issue_hot_buttons/javascripts/hot_buttons.js?1339107838" type="text/javascript"></script>
</pre></p>
<p>I would like include these links in tag "head"</p> Redmine - Defect #11105: <% content_for :header_tags do %> doesn't work inside hookhttps://www.redmine.org/issues/11105?journal_id=388162012-06-07T22:39:56ZVladimir Pitin
<ul><li><strong>Assignee</strong> set to <i>Jean-Philippe Lang</i></li></ul> Redmine - Defect #11105: <% content_for :header_tags do %> doesn't work inside hookhttps://www.redmine.org/issues/11105?journal_id=388552012-06-09T08:41:43ZJean-Philippe Langjp_lang@yahoo.fr
<ul><li><strong>Subject</strong> changed from <i>Mechanism <% content_for :header_tags do %> doesn't work</i> to <i>Mechanism <% content_for :header_tags do %> doesn't work inside hook</i></li><li><strong>Status</strong> changed from <i>New</i> to <i>Confirmed</i></li><li><strong>Resolution</strong> deleted (<del><i>Cant reproduce</i></del>)</li></ul> Redmine - Defect #11105: <% content_for :header_tags do %> doesn't work inside hookhttps://www.redmine.org/issues/11105?journal_id=388562012-06-09T09:20:48ZJean-Philippe Langjp_lang@yahoo.fr
<ul><li><strong>Subject</strong> changed from <i>Mechanism <% content_for :header_tags do %> doesn't work inside hook</i> to <i><% content_for :header_tags do %> doesn't work inside hook</i></li><li><strong>Status</strong> changed from <i>Confirmed</i> to <i>Resolved</i></li><li><strong>Target version</strong> set to <i>2.0.3</i></li><li><strong>Resolution</strong> set to <i>Fixed</i></li></ul><p>Fixed in <a class="changeset" title="Fixed that content_for does not work in Hook.render_on (#11105)." href="https://www.redmine.org/projects/redmine/repository/svn/revisions/9785">r9785</a>.</p> Redmine - Defect #11105: <% content_for :header_tags do %> doesn't work inside hookhttps://www.redmine.org/issues/11105?journal_id=388662012-06-09T13:57:35ZJean-Philippe Langjp_lang@yahoo.fr
<ul><li><strong>Status</strong> changed from <i>Resolved</i> to <i>Closed</i></li></ul><p>Merged in 2.0-stable.</p> Redmine - Defect #11105: <% content_for :header_tags do %> doesn't work inside hookhttps://www.redmine.org/issues/11105?journal_id=595792014-11-03T21:43:02ZGo MAEDA
<ul><li><strong>Related to</strong> <i><a class="issue tracker-1 status-10 priority-4 priority-default" href="/issues/11527">Defect #11527</a>: content_for :header_tag not working within partials</i> added</li></ul>