TechLadies/home-web

View on GitHub
app/views/involvements/new.js.erb

Summary

Maintainability
Test Coverage
$('#modal .modal-title').html('Add <%= @form.involvement.involvable_type %> to Case');
$('#modal .modal-body').html("<%= j render(partial: 'new')%>");
$('#modal .modal-footer').hide();

$('#form_involvement_attributes_involvable_id').select2({
  ajax: {
    url: "<%= case_involvements_path(@case_file, t: @form.involvement.involvable_type, i: params[:agency] ? 'Agency' : nil) %>",
    dataType: 'json',
    delay: 250,
    cache: true
  },
  width: '100%'
});

$('#flash-messages').replaceWith("<%= j render(partial: '/layouts/flash_messages') %>");
$('#modal').modal('show');