31 lines
679 B
Text
31 lines
679 B
Text
<%= form_with model: @article, local: true 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.full_messages.each do |msg| %>
|
|
<li><%= msg %></li>
|
|
<% end %>
|
|
</ul>
|
|
</div>
|
|
<% end %>
|
|
|
|
<p>
|
|
<%= form.label :title %>
|
|
<%= form.text_field :title %>
|
|
</p>
|
|
|
|
<p>
|
|
<%= form.label :text %>
|
|
<%= form.text_area :text, :class => 'u-full-width' %>
|
|
</p>
|
|
|
|
<p>
|
|
<%= form.submit 'Submit Article', :class => 'button-primary' %>
|
|
</p>
|
|
|
|
<% end %>
|