Dashboard/app/views/dashboard/examples/_form.html.erb

27 lines
621 B
Text

<%= form_with(model: example) do |form| %>
<% if example.errors.any? %>
<div style="color: red">
<h2><%= pluralize(example.errors.count, "error") %> prohibited this example from being saved:</h2>
<ul>
<% example.errors.each do |error| %>
<li><%= error.full_message %></li>
<% end %>
</ul>
</div>
<% end %>
<div>
<%= form.label :text, style: "display: block" %>
<%= form.text_field :text %>
</div>
<div>
<%= form.label :body, style: "display: block" %>
<%= form.text_area :body %>
</div>
<div>
<%= form.submit %>
</div>
<% end %>