From d9b7fd89f215489eb775afb3936bfd5d67f6e340 Mon Sep 17 00:00:00 2001 From: Jared Cosulich Date: Sun, 29 Jul 2018 10:30:07 -0400 Subject: [PATCH] normalized question text --- app/models/question.rb | 4 ++++ app/views/questions/_question.html.haml | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/app/models/question.rb b/app/models/question.rb index 2798cf84..884ac99e 100644 --- a/app/models/question.rb +++ b/app/models/question.rb @@ -63,4 +63,8 @@ class Question < ApplicationRecord most_popular_answer ) end + + def normalized_text + text.gsub("[science/math/English/social studies]", "") + end end diff --git a/app/views/questions/_question.html.haml b/app/views/questions/_question.html.haml index 44269942..111e62db 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 + = question.normalized_text .row.pt-2 .col-4.indicator-container.centered