Merge branch 'enterprise-fee-naming-example'

This commit is contained in:
Rohan Mitchell
2014-09-02 13:39:11 +10:00
2 changed files with 3 additions and 2 deletions

View File

@@ -12,8 +12,9 @@ class AngularFormBuilder < ActionView::Helpers::FormBuilder
# @object.send(@fields_for_record_name).first.class.to_s.underscore --> enterprise_fee
value = "{{ #{@object.send(@fields_for_record_name).first.class.to_s.underscore}.#{method} }}"
options.reverse_merge!({'id' => angular_id(method)})
@template.text_field_tag angular_name(method), value, :id => angular_id(method)
@template.text_field_tag angular_name(method), value, options
end
def ng_hidden_field(method, options = {})

View File

@@ -27,7 +27,7 @@
= f.ng_hidden_field :id
= f.ng_collection_select :enterprise_id, @enterprises, :id, :name, 'enterprise_fee.enterprise_id', :include_blank => true
%td= f.ng_select :fee_type, enterprise_fee_type_options, 'enterprise_fee.fee_type'
%td= f.ng_text_field :name
%td= f.ng_text_field :name, { placeholder: 'e.g. packing fee' }
%td= f.ng_collection_select :calculator_type, @calculators, :name, :description, 'enterprise_fee.calculator_type', {'class' => 'calculator_type', 'ng-model' => 'calculatorType', 'spree-ensure-calculator-preferences-match-type' => "1"}
%td{'ng-bind-html-unsafe-compiled' => 'enterprise_fee.calculator_settings'}
%td.actions{'spree-delete-resource' => "1"}