aboutsummaryrefslogtreecommitdiffstats
path: root/app/helpers/application_helper.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/helpers/application_helper.rb')
-rw-r--r--app/helpers/application_helper.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index 797aab166..3b5bfdfda 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -4,6 +4,17 @@ module ApplicationHelper
@referential.present? and not @referential.new_record?
end
+ def polymorphic_path_patch( source)
+ relative_url_root = Rails.application.config.relative_url_root
+ relative_url_root && !source.starts_with?("#{relative_url_root}/") ? "#{relative_url_root}#{source}" : source
+ end
+ def assets_path_patch( source)
+ relative_url_root = Rails.application.config.relative_url_root
+ return "/assets/#{source}" unless relative_url_root
+ "#{relative_url_root}/assets/#{source}"
+ end
+
+
def help_page?
controller_name == "help"
end