module PhantomHelpers::ViewHelpers::ExtrasHelper

Public Instance Methods

color_code(color) click to toggle source
# File lib/phantom_helpers/view_helpers/extras_helper.rb, line 15
def color_code(color)
  content_tag :div, nil, style: "width:100px;height:20px;background-color:#{color}"
end
comma_separated_list(objects, &block) click to toggle source
# File lib/phantom_helpers/view_helpers/extras_helper.rb, line 23
def comma_separated_list(objects, &block)
  if objects.any?
    objects.map do |object|
      block_given? ? block.call(object) : object
    end.join(', ').html_safe
  else
    t(:empty)
  end
end
datepicker_date_format(date) click to toggle source
# File lib/phantom_helpers/view_helpers/extras_helper.rb, line 19
def datepicker_date_format(date)
  date ?  date.strftime('%Y-%m-%d') : Time.now.strftime('%Y-%m-%d')
end
drag_field() click to toggle source
# File lib/phantom_helpers/view_helpers/extras_helper.rb, line 5
def drag_field
  content_tag :td, class: 'sort-handler' do
    content_tag :i, nil, class: 'icon-move'
  end
end
required_field() click to toggle source
# File lib/phantom_helpers/view_helpers/extras_helper.rb, line 11
def required_field
  content_tag :span, t(:required), class: 'label label-important pull-right'
end