|
|
|
@ -679,15 +679,15 @@ module ApplicationHelper
|
|
|
|
|
def textilizable(*args)
|
|
|
|
|
options = args.last.is_a?(Hash) ? args.pop : {}
|
|
|
|
|
case args.size
|
|
|
|
|
when 1
|
|
|
|
|
obj = options[:object]
|
|
|
|
|
text = args.shift
|
|
|
|
|
when 2
|
|
|
|
|
obj = args.shift
|
|
|
|
|
attr = args.shift
|
|
|
|
|
text = obj.send(attr).html_safe.to_s
|
|
|
|
|
else
|
|
|
|
|
raise ArgumentError, 'invalid arguments to textilizable'
|
|
|
|
|
when 1
|
|
|
|
|
obj = options[:object]
|
|
|
|
|
text = args.shift
|
|
|
|
|
when 2
|
|
|
|
|
obj = args.shift
|
|
|
|
|
attr = args.shift
|
|
|
|
|
text = obj.send(attr).to_s
|
|
|
|
|
else
|
|
|
|
|
raise ArgumentError, 'invalid arguments to textilizable'
|
|
|
|
|
end
|
|
|
|
|
return '' if text.blank?
|
|
|
|
|
project = options[:project] || @project || (obj && obj.respond_to?(:project) ? obj.project : nil)
|
|
|
|
@ -727,7 +727,7 @@ module ApplicationHelper
|
|
|
|
|
when 2
|
|
|
|
|
obj = args.shift
|
|
|
|
|
attr = args.shift
|
|
|
|
|
text = obj.send(attr).html_safe.to_s
|
|
|
|
|
text = obj.send(attr).to_s
|
|
|
|
|
else
|
|
|
|
|
raise ArgumentError, 'invalid arguments to textilizable'
|
|
|
|
|
end
|
|
|
|
|