class ActiveAdmin::Views::IndexAsTable
Public Instance Methods
fetch_path(field)
click to toggle source
# File lib/active_admin_simple_life/extensions.rb, line 33 def fetch_path(field) "edit_admin_#{field.class.to_s.underscore}_path" end
genders()
click to toggle source
# File lib/active_admin_simple_life/extensions.rb, line 23 def genders [[I18n.t("active_admin.genders.male"), true], [I18n.t("active_admin.genders.female"), false]] end
span_false()
click to toggle source
# File lib/active_admin_simple_life/extensions.rb, line 19 def span_false Arbre::Context.new { span(class: "status_tag no") { I18n.t "boolean.not_active" } } end
span_true()
click to toggle source
# File lib/active_admin_simple_life/extensions.rb, line 15 def span_true Arbre::Context.new { span(class: "status_tag yes") { I18n.t("boolean.active") } } end
truncate_field(field, max_length = 50)
click to toggle source
# File lib/active_admin_simple_life/extensions.rb, line 28 def truncate_field(field, max_length = 50) length = max_length || 50 truncate(field.to_s, length: length) end