Redmineflux Icon Compat

redmineflux_icon_compat provides one helper API for plugin links that works in both:

  • Redmine 5 legacy icon classes (icon icon-*)
  • Redmine 6 sprite icons (sprite_icon)

Use rf_icon_link to keep one code path across Redmine versions.

Install In A Redmine Plugin

1) Add the gem to your plugin Gemfile

Create or update plugins/<your_plugin>/Gemfile.

Local development:

gem 'redmineflux_icon_compat', path: '../redmineflux_icon_compat'

From RubyGems:

gem 'redmineflux_icon_compat', '~> 0.1.2'

2) Install dependencies

From Redmine root:

bundle install

3) Require the gem in plugin init

In plugins/<your_plugin>/init.rb:

require 'redmineflux_icon_compat'
module MyPluginHelper
  include RedminefluxIconCompat::Helper
end

ERB example:

<%= rf_icon_link(:add, 'Add Checklist', '#', class: 'add-checklist-btn') %>

Helper example:

rf_icon_link(:edit, l(:button_edit), edit_path(record))

6) Restart Redmine

Restart the app server after gem/helper changes so code reload is clean.

Troubleshooting

If you still see old icons:

  • clear cache: rm -rf tmp/cache/*
  • reinstall dependencies: bundle install
  • restart Redmine
  • hard refresh browser (Ctrl+Shift+R)

Run Tests

From Redmine root:

ruby plugins/redmineflux_icon_compat/test/helper_test.rb

From this gem directory:

ruby test/helper_test.rb