From b98d77a15343d90b8e0b029530d514bc4b430353 Mon Sep 17 00:00:00 2001 From: Jared Cosulich Date: Tue, 31 Oct 2017 20:26:50 -0400 Subject: [PATCH] formatting questions --- app/helpers/questions_helper.rb | 5 +++++ app/views/questions/_question.html.haml | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/app/helpers/questions_helper.rb b/app/helpers/questions_helper.rb index 2eaab4ab..3bb34d54 100644 --- a/app/helpers/questions_helper.rb +++ b/app/helpers/questions_helper.rb @@ -1,2 +1,7 @@ module QuestionsHelper + + def format_question(question_text) + question_text.gsub("[Field-MathTeacher][Field-ScienceTeacher][Field-EnglishTeacher][Field-SocialTeacher]", "teacher") + end + end diff --git a/app/views/questions/_question.html.haml b/app/views/questions/_question.html.haml index 44269942..2ab0cf64 100644 --- a/app/views/questions/_question.html.haml +++ b/app/views/questions/_question.html.haml @@ -4,7 +4,7 @@ .col-12.col-md-6.py-3 .question.p-2{id: "question-#{question.id}"} %p.question-text.pt-3.px-2 - = question.text + = format_question(question.text) .row.pt-2 .col-4.indicator-container.centered