Skip to content

Instantly share code, notes, and snippets.

@wolfieorama
Created April 25, 2016 16:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wolfieorama/6a60cac241e07f35660991645e045d16 to your computer and use it in GitHub Desktop.
Save wolfieorama/6a60cac241e07f35660991645e045d16 to your computer and use it in GitHub Desktop.
jQuery ->
jobs = $('#job_queue_id').html()
console.log(jobs);
$('#project_queue_id').change ->
project = $('#project_queue_id :selected').text()
options = $(jobs).filter("optgroup[label='#{project}']").html
if options
$('#job_queue_id').html(options)
else
$('#job_queue_id').empty()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment