Module: AdminBaseHelper

Defined in:
app/helpers/admin_base_helper.rb

Instance Method Summary collapse

Instance Method Details

#row_class(options = {}) ⇒ Object

This method returns a string for the table row class based on a work unit’s hours type. It uses cycle to candy-stripe the table for readability.



4
5
6
7
8
9
10
11
12
13
# File 'app/helpers/admin_base_helper.rb', line 4

def row_class(options={})
  classes = []
  classes.push(options[:hours_type].downcase) if options[:hours_type]

  classes.push("future") if options[:scheduled_at] > Time.current

  classes = classes.join(' ')

  cycle("#{classes} even","#{classes} odd")
end