2014-12-09 14:39:27 +01:00
|
|
|
<div class="row">
|
|
|
|
<div class="col-md-6 col-md-offset-3">
|
|
|
|
<%= form_for @product, html: { multipart: true } do |f| %>
|
|
|
|
<%= render 'application/errors', model: @product %>
|
|
|
|
|
|
|
|
<%= form_text_field f, :name %>
|
|
|
|
|
|
|
|
<%= f.label :price %>
|
|
|
|
<%= f.number_field :price, value: number_with_precision(f.object.price, precision: 2), class: 'form-control', placeholder: "0.00", step: :any %>
|
|
|
|
|
2014-12-10 21:25:21 +01:00
|
|
|
<%= form_collection_select f, :category, Product.categories.keys, :to_s, :titlecase %>
|
|
|
|
|
2014-12-09 14:39:27 +01:00
|
|
|
<%= f.label :avatar %>
|
|
|
|
<%= f.file_field :avatar %>
|
|
|
|
|
|
|
|
<%= f.submit class: "btn btn-primary" %>
|
|
|
|
<% end %>
|
|
|
|
</div>
|
|
|
|
</div>
|