Skip to content

Can't edit classes on input elements. #692

@antonysastre

Description

@antonysastre

Hi, i'm struggling with setting classes on input elements.
I'd be happy to contribute to the documentation but need to figure it out first.

I'm trying to add a class to the select input, this is what i've so far:

<%= f.select :client_id, options_from_collection_for_select(Client.all, :id, :name), class: 'form-select-sm' %>

- html: { class: 'form-select-sm' }
- html_options: { class: 'form-select-sm' }
- html_options: { control_class: 'form-select-sm' }
- wrapper_class: 'form-select-sm'

None of these change the actual input class. It still produces:

<select class="form-select" name=[…]>

Similarly, trying to change the 'mb-3' class on a checkbox input using the same method above never overwrites the default margin. I can't find anything in the docs, am i missing something?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions