module ApplicationHelper
- include VersionHelper
-
def current_user
controller.current_user
end
@unique_id ||= (Time.now.to_f*1000000).to_i
span_id = object.uuid.to_s + '-' + attr.to_s + '-' + (@unique_id += 1).to_s
+ if attr == 'description'
+ input_type = 'textarea'
+ end
span_tag = content_tag 'span', rendervalue, {
"data-emptytext" => '(none)',
"data-placement" => "bottom",
end
end
- if dataclass.andand.is_a?(Class)
- datatype = 'select'
- elsif dataclass == 'number'
- datatype = 'number'
- elsif attrvalue.is_a? Array
- # TODO: find a way to edit arrays with x-editable
- return attrvalue
- elsif attrvalue.is_a? Fixnum or attrvalue.is_a? Float
+ if dataclass == 'number' or attrvalue.is_a? Fixnum or attrvalue.is_a? Float
datatype = 'number'
elsif attrvalue.is_a? String
datatype = 'text'
+ elsif attrvalue.is_a?(Array) or dataclass.andand.is_a?(Class)
+ # TODO: find a way to edit with x-editable
+ return attrvalue
end
- lt = link_to attrtext, '#', {
+ # When datatype is a String or Fixnum, link_to the attrvalue
+ lt = link_to attrvalue, '#', {
"data-emptytext" => "none",
"data-placement" => "bottom",
"data-type" => datatype,