Tag: coffeescript

  • Using jquery us map to Create a Map of States That Can Be Toggled

    The us-map plugin was already in use elsewhere and I wanted to create a clickable map that would display an anchor state and allow for configuration of related states. Also in use is the gon gem to allow passing of data directly into Javascript, included in a Rails 4.1 project. Controller code: # assume @state is […]

  • CoffeeScript event handlers only working after page refresh

    I was able to find a resolution on StackOverflow to fix an event handler. I initially opted to added $(document).ready(…) and $(document).on(‘page:load’, …) handlers as follows: ready = -> $(‘form’).on ‘click’, ‘.clickable_class’, (event) -> # doStuff # added lines: $(document).ready(ready) $(document).on(‘page:load’, ready) However, another answer recommended adding the jquery-turbolinks instead. Browsing the source code, it […]