Class: Sinatra::Xeditable_Checkbox::Checkbox

Inherits:
Sinatra::XeditableAbstract show all
Defined in:
lib/sinatra/xeditable_checkbox.rb

Instance Method Summary collapse

Constructor Details

This class inherits a constructor from Sinatra::XeditableAbstract

Instance Method Details

#html(id, value) ⇒ Object



47
48
49
50
51
52
# File 'lib/sinatra/xeditable_checkbox.rb', line 47

def html(id, value)
  value_value = value.nil? ? "": value.join(",")
  value_text = (value.nil? or value.length==0) ? ::I18n::t(:empty) : value.map{|v|  @values[v.to_s]}.join(", ")
  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

#xeditable_typeObject



43
44
45
# File 'lib/sinatra/xeditable_checkbox.rb', line 43

def xeditable_type
  'checklist'
end