Answer the question
In order to leave comments, you need to log in
How to make the checkbox active by default in Ransack?
I do this:
I remove it, and then after submitting the form it remains marked again.
How to fix? f.check_box :active_true, {checked: true}, 1
Answer the question
In order to leave comments, you need to log in
You have . Therefore, the checkbox will always be in the state when the page is opened.
Instead , you need to substitute logic.
For example:checked: true
checked
f.check_box :active_true, { checked: @user.active? }, ...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question