Class: Sinatra::Xeditable_Checkbox::Checkbox
Instance Method Summary
collapse
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_type ⇒ Object
43
44
45
|
# File 'lib/sinatra/xeditable_checkbox.rb', line 43
def xeditable_type
'checklist'
end
|