Sha256: a48454ef7d279167d508fd507a4bd5e3af92bc60faae99c1ef65387413f07fad
Contents?: true
Size: 994 Bytes
Versions: 12
Compression:
Stored size: 994 Bytes
Contents
require 'builder' module RailsAdmin module Config module Fields module Types class Boolean < RailsAdmin::Config::Fields::Base # Register field type for the type loader RailsAdmin::Config::Fields::Types::register(self) register_instance_option :view_helper do :check_box end register_instance_option :formatted_value do case value when nil %{<span class="badge">-</span>} when false %{<span class="badge badge-important">✘</span>} when true %{<span class="badge badge-success">✓</span>} end.html_safe end register_instance_option :export_value do value.inspect end # Accessor for field's help text displayed below input field. register_instance_option :help do "" end end end end end end
Version data entries
12 entries across 12 versions & 2 rubygems