Skip to content

Commit 212ebe9

Browse files
committed
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
1 parent 544ccd7 commit 212ebe9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

app/views/puzzles/_puzzles_table.html.erb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
<tbody>
1515
<% puzzles.each do |puzzle| %>
1616
<tr>
17-
<td><%= puzzle.question %></td>
17+
<td><%= simple_format(puzzle.question) %></td>
1818
<td><%= puzzle.answer %></td>
1919
<td><%= puzzle.explanation %></td>
2020
<td>
@@ -43,4 +43,4 @@
4343
</tr>
4444
<% end %>
4545
</tbody>
46-
</table>
46+
</table>

0 commit comments

Comments
 (0)