Skip to content

Instantly share code, notes, and snippets.

@CreativeSoftware99
Created June 11, 2018 05:20
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/7ef7b9899c7169336f8c58c0bb4d7fee to your computer and use it in GitHub Desktop.
Save CreativeSoftware99/7ef7b9899c7169336f8c58c0bb4d7fee 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
%td
= f.text_field :name
%tr
%td
%label{:for => "product_price"}> Price
%td
= f.text_field :price
%tr
%td
%label{:for => "product_item_id"}> Item
%td
= f.select(:item_id) do
- @items.each do |item|
= content_tag(:option, item.name, value: item.id)
%tr
%td
%label{:for => "product_description"}> Description
%td
= f.text_area :description, size: "60x12"
%tr
%td
%label{:for => "product_image"}> Image
%td
= f.file_field :image
%tr
%td{:colspan => "2"}
%hr/
%tr
%td{:colspan => "2"}
= f.submit "Create"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment