mirror of
https://github.com/edcommonwealth/Dashboard.git
synced 2026-03-17 09:46:25 -07:00
set up example scaffold with rspec + factorybot tests
This commit is contained in:
parent
533c921a6d
commit
d1e6fb1e39
23 changed files with 512 additions and 6 deletions
27
app/views/dashboard/examples/_form.html.erb
Normal file
27
app/views/dashboard/examples/_form.html.erb
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
<%= 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 %>
|
||||
Loading…
Add table
Add a link
Reference in a new issue