-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<%= 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