-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy path_form.html.erb
More file actions
57 lines (50 loc) · 1.9 KB
/
_form.html.erb
File metadata and controls
57 lines (50 loc) · 1.9 KB
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
<%= form_with(model: topic) do |form| %>
<% if topic.errors.any? %>
<div style="color: red">
<h2><%= pluralize(topic.errors.count, "error") %> prohibited this topic from being saved:</h2>
<ul>
<% topic.errors.each do |error| %>
<li><%= error.full_message %></li>
<% end %>
</ul>
</div>
<% end %>
<div class="row">
<div class="col-md-4">
<div class="form-group">
<%= form.label :title, style: "display: block" %>
<%= form.text_field :title, id: "basicInput", class: "form-control", autofocus: true %>
</div>
</div>
<div class="col-md-4">
<div class="form-group">
<%= form.label :description, style: "display: block" %>
<%= form.text_area :description, id: "basicInput", class: "form-control" %>
</div>
</div>
<div class="col-md-4">
<div class="form-group">
<%= form.label :language_id, style: "display: block" %>
<%= form.collection_select :language_id, Language.all, :id, :name, {}, { id: "basicInput", class: "form-control" } %>
</div>
</div>
<div class="col-md-4">
<div class="form-group">
<%= form.label :provider_id, style: "display: block" %>
<%= form.collection_select :provider_id, Provider.all, :id, :name, {}, { id: "basicInput", class: "form-control" } %>
</div>
</div>
<div class="col-md-4">
<div class="form-group">
<%= form.label :archived, "Archived", for: "checkbox1", style: "display: block" %>
<%= form.check_box :archived, { id: "checkbox1", class: "form-check-input", checked: false } %>
</div>
</div>
</div>
<div class="mt-4">
<div class="col-12 d-flex justify-content-end">
<%= form.submit "Create Topic", class: "btn btn-primary me-1 mb-1" %>
<%= link_to "Cancel", topics_path, class: "btn btn-light-secondary me-1 mb-1" %>
</div>
</div>
<% end %>