Created
June 11, 2018 05:20
-
-
Save CreativeSoftware99/7ef7b9899c7169336f8c58c0bb4d7fee to your computer and use it in GitHub Desktop.
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_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