Sha256: 86f49d3b506b5f7672ff5b1eef577789700e9a5ed9e1f39a905325f56589ff59
Contents?: true
Size: 1.12 KB
Versions: 8
Compression:
Stored size: 1.12 KB
Contents
require 'builder' module RailsAdmin module MainHelper def rails_admin_form_for(*args, &block) options = args.extract_options!.reverse_merge(builder: RailsAdmin::FormBuilder) form_for(*(args << options), &block) << after_nested_form_callbacks end def get_indicator(percent) return '' if percent < 0 # none return 'info' if percent < 34 # < 1/100 of max return 'success' if percent < 67 # < 1/10 of max return 'warning' if percent < 84 # < 1/3 of max 'danger' # > 1/3 of max end def get_column_sets(properties) sets = [] property_index = 0 set_index = 0 while property_index < properties.length current_set_width = 0 loop do sets[set_index] ||= [] sets[set_index] << properties[property_index] current_set_width += (properties[property_index].column_width || 120) property_index += 1 break if current_set_width >= RailsAdmin::Config.total_columns_width || property_index >= properties.length end set_index += 1 end sets end end end
Version data entries
8 entries across 8 versions & 1 rubygems