Skip to content

Instantly share code, notes, and snippets.

@pullmonkey
Created August 16, 2012 23:40
Show Gist options
  • Save pullmonkey/3374533 to your computer and use it in GitHub Desktop.
Save pullmonkey/3374533 to your computer and use it in GitHub Desktop.
the erb version of dynamic select box js updater for rails 3
# app/views/home/update_artists.js.haml
$('#artists_select').html("<%= escape_javascript(options_for_select(@artists)) %>");
$('#songs_select').html("<%= escape_javascript(options_for_select(@songs)) %>");
# app/views/home/update_songs.js.haml
$('#songs_select').html("<%= escape_javascript(options_for_select(@songs)) %>");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment