lib/sinatra/xeditable_abstract.rb
# Hash of key, values to put on select
Hash of key, values to put on select
Hash of key values to put on select
def javascript
      source = values.map {|v|
        "{value:'#{v[0]}', text:'#{v[1].gsub("'", "")}'}"
      }.join(",\n")
      "
$(document).ready(function () {
$('.#{html_class}').editable({
type:'#{xeditable_type}',
title:'#{title}',
mode:'inline',
ajaxOptions: {
    type: '#{method}'
},
url:'#{url_data}',
source: [#{source}]
});
});
"
    end
def javascript source = values . map { | v | "{value:'#{v[0]}', text:'#{v[1].gsub("'", "")}'}" } . join ( ",\n" ) "
$(document).ready(function () {
$('.#{html_class}').editable({
type:'#{xeditable_type}',
title:'#{title}',
mode:'inline',
ajaxOptions: {
    type: '#{method}'
},
url:'#{url_data}',
source: [#{source}]
});
});
" end
Hash of key, values to put on select
Hash of key values to put on select