Module: AdminBaseHelper
- Defined in:
- app/helpers/admin_base_helper.rb
Instance Method Summary collapse
-
#row_class(options = {}) ⇒ Object
This method returns a string for the table row class based on a work unit’s hours type.
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(={}) classes = [] classes.push([:hours_type].downcase) if [:hours_type] classes.push("future") if [:scheduled_at] > Time.current classes = classes.join(' ') cycle("#{classes} even","#{classes} odd") end |