0

I've got a simple button, which (should) turn the value of a Boolean into true:

= simple_form_for @item do |f|
    = f.check_box :is_active, {checked: true} #Hide via CSS, it is actually checked.
    = f.button :submit, 'Publish', class: 'btn'

Should that form be inove and I made a mistake in it? Or do I need some Controller Stuff? When I press that Button, the Boolean stays false.

Thanks in advance for each answer! Please tell me if you need additional information.

Gugubaight
  • 187
  • 13

1 Answers1

0

You can try

f.input :is_active, as: :boolean, checked_value: true, unchecked_value: false

In the Readme of the repo in section Usage

part:

Simple Form accepts same options as their corresponding input type helper in Rails:

and also in other parts

inye
  • 1,786
  • 1
  • 23
  • 31