armandofox/audience1st

View on GitHub
app/views/vouchers/_reserve_comps_for.html.haml

Summary

Maintainability
Test Coverage
.form-row.my-2
  %label.col-2.text-right.col-form-label{:for => 'comp_order_showdate_id'}  Reserve for:
  - options = @valid_vouchers.empty? ? options_for_select(['(Select comp type first)']) : options_from_collection_for_select(@valid_vouchers, 'showdate_id', 'show_name_with_seats_of_type_remaining')
  = select 'comp_order','showdate_id', options, {:include_blank => "Leave Open"}, {:class => 'form-control col-4'}
  .col-3.text-left= display_seats_field(:extra_classes => 'd-none')
  :javascript
    $('#comp_order_vouchertype_id').change(function() {
      var url = "#{escape_javascript(update_shows_path)}" + '?' + $.param({"vouchertype_id" : $(this).val()});
      $('#reserve_for').load(url);
    });