I’m attempting to get autocomplete working on a rails app. I’m basically following the instructions in Railscast #102 (revised). It wasn’t working because I didn’t realize that coffeescript was whitespace sensitive. Once I realized that, I thought I was set, but I wasn’t. I like having my tabs be two spaces, but coffeescript wants four space tabs. So after I doubled all of my tabs, things started working.

jQuery ->
    $('#measurement_plate_name').autocomplete
        source: $('#measurement_plate_name').data('autocomplete-source')