I have the following (simple) CoffeeScript jQuery Plugin:
$ = jQuery
$.fn.extend
schoolSelect: (options) ->
settings =
apiUrl: '/api/v1'
debug: false
settings = $.extend settings, options
log = (msg) ->
console?.log msg if settings.debug
return @each ->
@.dropkick
change: (val, label) ->
log val
log label
And I call it in another CoffeeScript file like so:
$('.school_select').schoolSelect
debug: true
But for some reason I keep getting the following error:
Uncaught TypeError: Object #<HTMLSelectElement> has no method 'dropkick'
I am using the DropKickjQuery plugin for my HTML selects: http://jamielottering.github.com/DropKick/
How can I access the DropKick plugin within my CoffeeScript jQuery plugin?