diff --git a/app/controllers/calculations_controller.rb b/app/controllers/calculations_controller.rb index 0df2d0f..b3b1381 100644 --- a/app/controllers/calculations_controller.rb +++ b/app/controllers/calculations_controller.rb @@ -11,11 +11,11 @@ def word_count # ================================================================================ - @word_count = "Replace this string with your answer." + @word_count = @text.split.count - @character_count_with_spaces = "Replace this string with your answer." + @character_count_with_spaces = @text.length - @character_count_without_spaces = "Replace this string with your answer." + @character_count_without_spaces = @text.gsub(/\s+/, "").length @occurrences = "Replace this string with your answer."