From b0ceeea6503c00c7a5d47e4c446a123e2cb53860 Mon Sep 17 00:00:00 2001 From: Ralf Teusner Date: Fri, 28 Oct 2016 17:22:31 +0200 Subject: [PATCH] fix retrieval of relative_url_root also for other calls. --- app/assets/javascripts/exercises.js.erb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/assets/javascripts/exercises.js.erb b/app/assets/javascripts/exercises.js.erb index 73799bec..2a17b405 100644 --- a/app/assets/javascripts/exercises.js.erb +++ b/app/assets/javascripts/exercises.js.erb @@ -1,6 +1,6 @@ $(function() { // ruby part adds the relative_url_root, if it is set. - var ACE_FILES_PATH = '<%= (defined? config.relative_url_root) && config.relative_url_root != nil && config.relative_url_root != "" ? config.relative_url_root : "" %>' + '/assets/ace/'; + var ACE_FILES_PATH = '<%= (defined? Rails.application.config.relative_url_root) && Rails.application.config.relative_url_root != nil && Rails.application.config.relative_url_root != "" ? Rails.application.config.relative_url_root : "" %>' + '/assets/ace/'; var THEME = 'ace/theme/textmate'; var TAB_KEY_CODE = 9; @@ -211,7 +211,7 @@ $(function() { }; var updateFileTemplates = function(fileType) { - var rel_url_root = '<%= (defined? config.relative_url_root) && config.relative_url_root != nil && config.relative_url_root != "" ? config.relative_url_root : "" %>'; + var rel_url_root = '<%= (defined? Rails.application.config.relative_url_root) && Rails.application.config.relative_url_root != nil && Rails.application.config.relative_url_root != "" ? Rails.application.config.relative_url_root : "" %>'; var jqxhr = $.ajax({ url: rel_url_root + '/file_templates/by_file_type/' + fileType + '.json', dataType: 'json'