Customizing simple_form boolean input

68 views
Skip to first unread message

Jasper Rädisch

unread,
Feb 2, 2017, 3:28:17 AM2/2/17
to SimpleForm
Good morning!

(This is a cross post from http://stackoverflow.com/questions/41996812/customizing-simple-form-boolean-input but I figured this is the preferred channel. Please feel free to answer wherever you like.)

To add some markup to a boolean input (checkbox), I am trying to create a custom input like this:

    class BooleanWithIconInput < SimpleForm::Inputs::BooleanInput
      def input(wrapper_options)
        super
      end
    end

The problem is, that this input is already displayed differently, since it is missing a `<div class="checkbox">` container and it adds classes like `control_label` and `form_control`.

Why is that happening, and how can I get the same behaviour?

Thank you for an excellent gem!

Jasper
Reply all
Reply to author
Forward
0 new messages