         results: data
         more: data.length > 0
 
-  buildimageOptions: ->
+  buildImageOptions: ->
     @options.formatResult = (item) ->
       html = '<div class="fancy_select-result">'
       html += "<img src='#{item.image}' alt='#{item.text}'>" if item.image


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

      @initCreateChoiceOnce()
      @initCreateChoice()
    @options

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

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