mirror of
https://github.com/redmine/redmine.git
synced 2025-11-04 20:35:57 +01:00
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
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user