2021-09-26 15:22:36 -07:00
|
|
|
<%= form_with(model: article) do |form| %>
|
|
|
|
|
<% if article.errors.any? %>
|
|
|
|
|
<div id="error_explanation">
|
|
|
|
|
<h2><%= pluralize(article.errors.count, "error") %> prohibited this article from being saved:</h2>
|
|
|
|
|
|
|
|
|
|
<ul>
|
|
|
|
|
<% article.errors.each do |error| %>
|
|
|
|
|
<li><%= error.full_message %></li>
|
|
|
|
|
<% end %>
|
|
|
|
|
</ul>
|
|
|
|
|
</div>
|
|
|
|
|
<% end %>
|
|
|
|
|
|
|
|
|
|
<div class="field">
|
|
|
|
|
<%= form.label :title %>
|
|
|
|
|
<%= form.text_field :title %>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="field">
|
2021-12-16 14:32:18 -08:00
|
|
|
<%= form.label :content %>
|
|
|
|
|
<%= form.rich_text_area :content %>
|
2021-09-26 15:22:36 -07:00
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="actions">
|
|
|
|
|
<%= form.submit %>
|
|
|
|
|
</div>
|
|
|
|
|
<% end %>
|