Open gabrieletassoni opened 1 year ago
I'm having the exact same issue for rails_admin
3.1.1 and rails
7.0.4.
I fixed it on my side for now by adding
attribute :your_bool_field_here, ActiveModel::Type::Boolean.new
in my model.
I think the problem is in https://github.com/railsadminteam/rails_admin/blob/master/lib/rails_admin/config/fields/types/boolean.rb function form_value
. The value was '1' instead of true. Telling active_record that it was a boolean did the trick, but it was the first time I had to do that.
Describe the bug On the Create and Edit UIs the checkboxes for non nullable boolean fields does not seem to wokr, clicking on them does not show a checkmark.
Reproduction steps Add a non nullable field to a model (in this case User)
Run
rails s
Open the browser to http://localhost:3000 and navigate to User page generated by rails admin. Click on "Create +" button. The admin field created in the migration, does not work as expected.Expected behavior I expect to see the checkmark appear if I click on it.
Additional context
rails
version: 7rails_admin
version: 3.1.2rails_admin
npm package version: not used, using sprockets