lib/sinatra/xeditable_select.rb
# Value that represent the nil option. If the value incorpored on html method
# is nil, it will be replaced with this
Value that represent the nil option. If the value incorpored on html method
is nil, it will be replaced with this
Value that represent the nil option . If the value incorpored on html method is nil it will be replaced with this
def html(id, value)
        value_value = (value && 1 || 0) if [TrueClass, FalseClass].include?(value.class)
        value_value ||= value.nil? ? nil_value.to_s : value.to_s
        value_text = value.nil? ? values[nil_value.to_s] : values[value.to_s]
        return value_text if !active
        "<a href='#' class='#{html_class}' id='select-#{html_class}-#{id}' data-value='#{value_value}' data-pk='#{id}'>#{value_text}</a>"
      end
def html ( id , value ) value_value = ( value && 1 || 0 ) if [ TrueClass , FalseClass ] . include? ( value . class ) value_value ||= value . nil? ? nil_value . to_s : value . to_s value_text = value . nil? ? values [ nil_value . to_s ] : values [ value . to_s ] return value_text if ! active "<a href='#' class='#{html_class}' id='select-#{html_class}-#{id}' data-value='#{value_value}' data-pk='#{id}'>#{value_text}</a>" end
Value that represent the nil option.
Value that represent the nil option .
id
value