Add some view structure

This commit is contained in:
2014-04-17 23:05:35 +02:00
parent 45f8ea1308
commit 2a5331471c
23 changed files with 207 additions and 115 deletions
+24 -11
View File
@@ -1,18 +1,31 @@
= simple_form_for [:suppliers, @product], html: {class: 'form-horizontal'} do |f|
= form_for [:suppliers, @product] do |f|
= render 'error_messages', target: @product
= f.input :name
= f.input :code
= f.input :price
.control-group
.form-row
.form-label
= f.label :name, data: {t: 'attributes.product.name'}
.form-field
= f.text_field :name
.form-row
.form-label
= f.label :code, data: {t: 'attributes.product.code'}
.form-field
= f.text_field :code
.form-row
.form-label
= f.label :price, data: {t: 'attributes.product.price'}
.form-field
= f.text_field :price
/= f.input :name
/= f.input :code
/= f.input :price
.form-row
= hidden_field_tag 'product[product_category_ids][]', []
= label_tag nil, ProductCategory.model_name.human_plural, class: 'control-label'
.controls
.form-label
= label_tag nil, ProductCategory.model_name.human_plural, class: 'control-label'
.form-field
- for product_category in current_supplier.product_categories
= check_box_tag "product[product_category_ids][]", product_category.id, @product.product_categories.to_a.include?(product_category), id: "product-category-checker-#{product_category.id}"
= label_tag "product-category-checker-#{product_category.id}", product_category.name
br
.form-actions
= f.button :submit, class: 'btn-primary save-product-button'
'
= link_to t("helpers.links.cancel"), suppliers_products_path, class: 'btn'
= f.supplier_form_actions