ruby-on-railsruby-on-rails-4rails-adminrails-administrate

rails_admin change boolean default icon true and false instead string 'true' and 'false'


enter image description here

I did created on one model with boolean field

rails g model saas reserved_seat:boolean

when i add new record it will show only ✓ , ✘ and ‒

enter image description here

Instead i need to value display neither 'true' or 'false' nor 'ON' or 'OFF' in string


Solution

  • What I did was:

    field :reserved_seat do
       pretty_value do
        if bindings[:object].reserved_seat==true
            %{<span style="color:blank;" >ON</span>}.html_safe
          else
            %{<span style="color:blank;" >OFF</span>}.html_safe
        end
      end
     end