-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy path_form.html.erb
35 lines (29 loc) · 1.01 KB
/
_form.html.erb
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
34
35
<%= form_with(model: board) do |form| %>
<% if board.errors.any? %>
<div id="error_explanation">
<h2><%= pluralize(board.errors.count, "error") %> prohibited this board from being saved:</h2>
<ul>
<% board.errors.full_messages.each do |message| %>
<li><%= message %></li>
<% end %>
</ul>
</div>
<% end %>
<div class="mb-3">
<%= form.label :name, class: 'form-label' %>
<%= form.text_field :name, class: 'form-control form-control-lg', placeholder: 'Rello Board Name' %>
</div>
<div class="mb-3">
<% if board.persisted? %>
<div class="float-end">
<%= link_to 'Destroy', board, method: :delete, class: "text-danger", data: { confirm: 'Are you sure?' } %>
</div>
<% end %>
<%= form.submit class: 'mt-2 btn btn-success btn-lg' %>
<% if board.persisted? %>
<%= link_to "Cancel", board, class: "btn btn-link" %>
<% else %>
<%= link_to "Cancel", boards_path, class: "btn btn-link" %>
<% end %>
</div>
<% end %>