initial commit

This commit is contained in:
2012-08-22 18:15:37 +02:00
commit 0856528f5e
120 changed files with 3048 additions and 0 deletions
+14
View File
@@ -0,0 +1,14 @@
= form_for @table, html: {class: 'form-horizontal' } do |f|
= render 'error_messages', target: @table
.control-group class=(@table.errors[:number].any? ? 'error' : nil)
= f.label :number, class: 'control-label'
.controls
= f.text_field :number, class: 'text_field'
.control-group class=(@table.errors[:supplier_id].any? ? 'error' : nil)
= f.label :supplier_id, Supplier.model_name.human, class: 'control-label'
.controls
= f.select :supplier_id, options_for_select(@suppliers.map{|a| [a.name, a.id]}), include_blank: nil
.form-actions
= f.submit nil, class: 'btn btn-primary'
'
= link_to t("helpers.links.cancel"), tables_path, class: 'btn'
+4
View File
@@ -0,0 +1,4 @@
- model_class = Table
.page-header
= title :edit, model_class
= render 'form'
+24
View File
@@ -0,0 +1,24 @@
- model_class = Table
div.page-header= title :index, model_class
- if @tables.any?
table.table.table-striped
thead
tr
th= model_class.human_attribute_name(:number)
th= Supplier.model_name.human
th= model_class.human_attribute_name(:created_at)
th=t 'helpers.actions'
tbody
- @tables.each do |table|
tr
td= link_to table.number, table
td= link_to table.supplier.name, table.supplier
td=l table.created_at, format: :short
td
= link_to t('helpers.links.edit'), [:edit, table], class: 'btn btn-mini'
'
= link_to t("helpers.links.destroy"), table, method: :delete, data: {confirm: are_you_sure? }, class: 'btn btn-mini btn-danger'
- else
= no_content_given model_class
= link_to t("helpers.links.new"), new_table_path, class: 'btn btn-primary'
+4
View File
@@ -0,0 +1,4 @@
- model_class = Table
.page-header
= title :new, model_class
= render 'form'
+16
View File
@@ -0,0 +1,16 @@
- model_class = Table
.page-header= title :show, @table
dl.dl-horizontal.show-list
dt= model_class.human_attribute_name(:number)
dd= @table.number
- if @table.supplier.present?
dt= Supplier.model_name.human
dd= link_to @table.supplier.name, @table.supplier
.form-actions
= link_to t("helpers.links.back"), tables_path, class: 'btn'
'
= link_to t('helpers.links.edit'), [:edit, @table], class: 'btn'
'
= link_to t("helpers.links.destroy"), @table, method: :delete, data: {confirm: are_you_sure? }, class: 'btn btn-danger'