 
   initAjaxInput: ->
     if @el.data('image')
-      @buildimageOptions()
+      @buildImageOptions()
     if @el.data('result')
       @options.formatResult = (item) => fetchTemplate(@el.data('result'))(item)
     if @el.data('selection')

        @modal.data('target', this)
        fn = =>
          $('#modal_form form input[name$="[name]"]').val(term)
          @modal.modal()
        $.get @el.data('add'), {modal: true}, fn, 'script'
      null


      @initCreateChoiceOnce()
      @initCreateChoice()
    @options

  runModal: ->
    @el.trigger('select2.modal_open')
    @modal.modal()

  initSortable: ->
    @el.select2('container').find('ul.select2-choices').sortable
