Created
February 21, 2018 15:12
-
-
Save RJNY/332bf23881001af351ed1f65c9be6d74 to your computer and use it in GitHub Desktop.
_form.html.erb corrections
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
<div class="form-group"> | |
<%= form_with(model: product, local: true) do |form| %> | |
<% if product.errors.any? %> | |
<div id="error_explanation"> | |
<h2><%= pluralize(product.errors.count, "error") %> prohibited this product from being saved:</h2> | |
<ul> | |
<% product.errors.full_messages.each do |message| %> | |
<li><%= message %></li> | |
<% end %> | |
</ul> | |
</div> | |
<% end %> | |
<div class="field"> | |
<%= form.label :name %> | |
<%= form.text_field :name, id: :product_name, class: 'form-control' %> | |
</div> | |
<div class="field"> | |
<%= form.label :description %> | |
<%= form.text_area :description, id: :product_description, class: 'form-control' %> | |
</div> | |
<div class="field"> | |
<%= form.label :image_url %> | |
<%= form.text_field :image_url, id: :product_image_url, class: 'form-control' %> | |
</div> | |
<div class="field"> | |
<%= form.label :color %><br> | |
<%= form.text_field :color, class: 'form-control' %> | |
</div> | |
<div class="field"> | |
<%= form.label :price %><br> | |
<%= form.text_field :price, class: 'form-control' %> | |
</div> | |
<div class="actions"> | |
<%= form.submit class: 'btn btn-default' %> | |
</div> | |
<% end %> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment