<%= f.fields 'states' do |state_form_group| %>
<%= state_form_group.fields_for "#{idx}", state do |state_form| %>
<%= state_form.text_field :name %> |
<%= state_form.text_field :external_message %> |
<%= state_form.select :block_changes, options_for_select([true, false ], state.block_changes), :class => 'form-control' %> |
<%= state_form.select :subscription_cancellation_policy, options_for_select([:NONE, :POLICY_NONE, :POLICY_IMMEDIATE, :POLICY_END_OF_TERM], state.subscription_cancellation), :class => 'form-control' %> |
<%= state_form.fields_for 'condition' do |condition| %>
<%= condition.number_field :time_since_earliest_unpaid_invoice_equals_or_exceeds, :value => state.condition.time_since_earliest_unpaid_invoice_equals_or_exceeds.number %> |
<%= condition.select :control_tag_inclusion, options_for_select([:NONE, :AUTO_PAY_OFF, :AUTO_INVOICING_OFF, :OVERDUE_ENFORCEMENT_OFF, :MANUAL_PAY, :TEST, :PARTNER], state.condition.control_tag_inclusion), :class => 'form-control' %> |
<%= condition.select :control_tag_exclusion, options_for_select([:NONE, :AUTO_PAY_OFF, :AUTO_INVOICING_OFF, :OVERDUE_ENFORCEMENT_OFF, :MANUAL_PAY, :TEST, :PARTNER], state.condition.control_tag_exclusion), :class => 'form-control'%> |
<%= condition.number_field :number_of_unpaid_invoices_equals_or_exceeds, :value => state.condition.number_of_unpaid_invoices_equals_or_exceeds %> |
<%= condition.number_field :total_unpaid_invoice_balance_equals_or_exceeds, :step => :any, :value => state.condition.total_unpaid_invoice_balance_equals_or_exceeds %> |
<% end %>
<% end %>
<% end %>
<%= ''.html_safe %> |
<% end %>