-2

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

sathish
  • 300
  • 3
  • 14

2 Answers2

2

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   
Sebastián Palma
  • 32,692
  • 6
  • 40
  • 59
sathish
  • 300
  • 3
  • 14
1

Refer the documentation here wiki

RailsAdmin.config do |config|
  config.model 'Saas' do
    edit do
      field :reserved_seat, :string
    end
  end
end
Md. Farhan Memon
  • 6,055
  • 2
  • 11
  • 36
  • I did't changed boolean to string,i want to select the value with checkbox in my edit,but list field like display On or Off – sathish May 25 '17 at 13:59