Skip to content

Commit be293d1

Browse files
authored
Merge pull request #44 from fastruby/simple_format-on-edit-and-increase-text-area
Use simple_format on edit and increase text_area
2 parents dcb8e67 + 6dfdcba commit be293d1

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

app/views/puzzles/_form.html.erb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<%= form_with model: puzzle do |f| %>
22
<div class="modal-area">
33
<%= f.label :question %>
4-
<%= f.text_area :question, class: puzzle.errors[:question].any? ? "error" : "" %>
4+
<%= f.text_area :question, class: puzzle.errors[:question].any? ? "error" : "", rows: 10, cols: 40 %>
55
<% if puzzle.errors[:question].any? %>
66
<div class="field-error"><%= puzzle.errors[:question].first %></div>
77
<% end %>
@@ -21,7 +21,7 @@
2121

2222
<div class="modal-area">
2323
<%= f.label :explanation %>
24-
<%= f.text_area :explanation %>
24+
<%= f.text_area :explanation, rows: 10, cols: 40 %>
2525
</div>
2626

2727
<div class="modal-area">

app/views/puzzles/update.turbo_stream.erb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<turbo-stream action="replace" target="<%= dom_id(@puzzle) %>">
22
<template>
33
<tr id="<%= dom_id(@puzzle) %>">
4-
<td><%= @puzzle.question %></td>
4+
<td><%= simple_format(@puzzle.question) %></td>
55
<td><%= @puzzle.answer %></td>
66
<td><%= @puzzle.explanation %></td>
77
<td>
@@ -22,4 +22,4 @@
2222
</turbo-stream>
2323
<turbo-stream action="update" target="modal">
2424
<template></template>
25-
</turbo-stream>
25+
</turbo-stream>

0 commit comments

Comments
 (0)