Skip to content

Instantly share code, notes, and snippets.

@CreativeSoftware99
Created June 11, 2018 04:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save CreativeSoftware99/262ff1e94a30468497a459ffecb562c1 to your computer and use it in GitHub Desktop.
Save CreativeSoftware99/262ff1e94a30468497a459ffecb562c1 to your computer and use it in GitHub Desktop.
<%= form_for @product, url: {action: "create"}, html: {multipart: true} do |f| %>
<table>
<tr>
<td>
<label for = "product_name">Name</label>:
</td>
<td>
<%= f.text_field :name %>
</td>
</tr>
<tr>
<td>
<label for = "product_price">Price</label>:
</td>
<td>
<%= f.text_field :price %>
</td>
</tr>
<tr>
<td>
<label for = "product_item_id">Item</label>:
</td>
<td>
<%= f.select(:item_id) do %>
<% @items.each do |item| -%>
<%= content_tag(:option, item.name, value: item.id) %>
<% end %>
<% end %>
</td>
</tr>
<tr>
<td>
<label for = "product_description">Description</label>:
</td>
<td>
<%= f.text_area :description, size: "60x12" %>
</td>
</tr>
<tr>
<td>
<label for = "product_image">Image</label>:
</td>
<td>
<%= f.file_field :image %>
</td>
</tr>
<tr>
<td colspan="2"><hr /></td>
</tr>
<tr>
<td colspan="2">
<%= f.submit "Create" %>
</td>
</tr>
</table>
<% end %>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment