From 641250d2a945ecf4803f4f0c8ce6fa233304ac94 Mon Sep 17 00:00:00 2001 From: r888888888 Date: Mon, 25 Apr 2016 16:27:01 -0700 Subject: [PATCH] only enable ragel dtext for user 1 --- app/helpers/application_helper.rb | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index c532ab02b..60c6fe315 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -50,11 +50,19 @@ module ApplicationHelper end def format_text(text, options = {}) - raw(DTextRagel.parse(text)) + if CurrentUser.id == 1 + raw(DTextRagel.parse(text)) + else + DText.parse(text) + end end - def strip_dtext(text) - raw(DTextRagel.parse_strip(text)) + def strip_dtext(text, options = {}) + if CurrentUser.id == 1 + raw(DTextRagel.parse_strip(text)) + else + DText.parse_strip(text) + end end def error_messages_for(instance_name)