diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2012-04-28 09:18:12 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2012-04-28 09:18:12 +0000 |
commit | da43f785bea5ef7f8cc985358e8204ad0e0c7fdc (patch) | |
tree | fd2c3916d8d40db5495ff218811cd4ad1ee4611b /app | |
parent | 03335d014ceb42d8db670606e3960b5fd84cb7c3 (diff) | |
download | redmine-da43f785bea5ef7f8cc985358e8204ad0e0c7fdc.tar.gz redmine-da43f785bea5ef7f8cc985358e8204ad0e0c7fdc.zip |
Adds support for :plugin option to image_tag helper.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@9559 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app')
-rw-r--r-- | app/helpers/application_helper.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 743bc34e3..f54a85a02 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -1065,6 +1065,18 @@ module ApplicationHelper super sources, options end + # Overrides Rails' image_tag with plugins support. + # Examples: + # image_tag('image.png') # => picks defaults image.png + # image_tag('image.png', :plugin => 'foo) # => picks image.png from plugin's assets + # + def image_tag(source, options={}) + if plugin = options.delete(:plugin) + source = "/plugin_assets/#{plugin}/images/#{source}" + end + super source, options + end + # Overrides Rails' javascript_include_tag with plugins support # Examples: # javascript_include_tag('scripts') # => picks scripts.js from defaults |