Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <h1>Edit article</h1>
- <%= 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 %><br>
- <%= form.text_field :title %>
- </p>
- <p>
- <%= form.label :text %><br>
- <%= form.text_area :text %>
- </p>
- <p>
- <%= form.submit %>
- </p>
- <% end %>
- <%= link_to 'Back', articles_path %>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement