Skip to content

Instantly share code, notes, and snippets.

@nicedawg
Last active March 14, 2020 19:23
Show Gist options
  • Save nicedawg/5dd35d1922270369b41f52815b57b224 to your computer and use it in GitHub Desktop.
Save nicedawg/5dd35d1922270369b41f52815b57b224 to your computer and use it in GitHub Desktop.
[Beginning Rails 6] Listing 9-5. The Updated Comment Form in app/views/comments/_new.html.erb
<%= form_with(model: @article.comments.new, url: article_comments_path(@article)) do |form| %>
<div class="field">
<%= form.label :name %><br />
<%= form.text_field :name %>
</div>
<div class="field">
<%= form.label :email %><br />
<%= form.text_field :email %>
</div>
<div class="field">
<%= form.label :body %><br />
<%= form.text_area :body %>
</div>
<div class="actions">
<%= form.submit 'Add' %>
</div>
<% end %>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment