From b31d225302ce0b17f067e26470f2dbffeacdf233 Mon Sep 17 00:00:00 2001 From: Francois Buys Date: Tue, 7 Oct 2025 23:44:06 +0200 Subject: [PATCH] 25: Use simple_format to display puzzle questions Render puzzle question with line breaks Use Rails' simple_format helper to display puzzle questions with preserved line breaks in the table view. This improves readability for questions containing newline characters from the database. See: https://api.rubyonrails.org/classes/ActionView/Helpers/TextHelper.html --- app/views/puzzles/_puzzles_table.html.erb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/puzzles/_puzzles_table.html.erb b/app/views/puzzles/_puzzles_table.html.erb index 54276df..71b03f7 100644 --- a/app/views/puzzles/_puzzles_table.html.erb +++ b/app/views/puzzles/_puzzles_table.html.erb @@ -14,7 +14,7 @@ <% puzzles.each do |puzzle| %> - <%= puzzle.question %> + <%= simple_format(puzzle.question) %> <%= puzzle.answer %> <%= puzzle.explanation %> @@ -47,4 +47,4 @@ <% end %> - \ No newline at end of file +