-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path_form.html.erb
More file actions
33 lines (29 loc) · 836 Bytes
/
_form.html.erb
File metadata and controls
33 lines (29 loc) · 836 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<%= form_with model: puzzle do |f| %>
<div class="modal-area">
<%= f.label :question %>
<%= f.text_area :question, class: puzzle.errors[:question].any? ? "error" : "" %>
<% if puzzle.errors[:question].any? %>
<div class="field-error"><%= puzzle.errors[:question].first %></div>
<% end %>
</div>
<div class="modal-area">
<%= f.label :answer %><br>
<div class="answer-radio-group">
<label>
<%= f.radio_button :answer, "ruby" %> Ruby
</label>
<label>
<%= f.radio_button :answer, "rails" %> Rails
</label>
</div>
</div>
<div class="modal-area">
<%= f.label :explanation %>
<%= f.text_area :explanation %>
</div>
<div class="modal-area">
<%= f.label :link %>
<%= f.text_field :link %>
</div>
<%= f.submit "Save", class: "btn approve-btn" %>
<% end %>