$('[data-behavior~=date_picker]').live 'focus', ->
$(this).datepicker()
So basically every focus on the element creates a new datepicker. If you're not careful this could mean memory bloat and unpredictable behavior as the plugin is attached several times.