Project

General

Profile

Missing <link>-tag in my plugin

Added by Anton Hedström over 12 years ago

Hi!

I am writing a simple plugin that is hooking up to one of the basic hooks in redmine (view_layouts_base_body_bottom). I have created a partial view in my plugin dir: (/vendor/plugins/redmine_printify/app/views/_printing_link.erb). The view is rendered and everything works fine so far. But now I want to add some css to the view and therefore added:

<% content_for :header_tags do %>
  <%= stylesheet_link_tag 'style', :plugin => 'redmine_printify' %>
<% end %>

in my view. I also created the file style.css in /vendor/plugins/redmine_printify/assets/stylesheets/ which is properly copied into /public/plugin_assets/redmine_prinitify/stylesheets/ when reloading server. But the link-tag doesn't seem to be created.

If I remove the content_for :header_tags do and end the link-tag is created, but of course located in the body-tag (which isn't ok!). Am I not aloud to use content_for :header_tags inside a partial view or what's the problem?

I am using Redmine 1.3.0.stable.8201.

Thanks in advance!
// Anton