Skip to content

No offset in form_group classes without label when multiple cols values are specified #478

Closed
@0x0badc0de

Description

@0x0badc0de

Example:

<%= bootstrap_form_with(model: foo, layout: :horizontal, label_col: "col-sm-4 col-md-2", control_col: "col-sm-8 col-md-10") do |form| %>
  <%= form.form_group do %>
    <%= form.submit %>
  <% end %>
<% end %>

Resulting div for form_group will have class="col-sm-8 col-md-10 col-sm-4 col-md-2". While expected one is class="col-sm-8 col-md-10 offset-sm-4 offset-md-2"
Probably pattern in offset_col should be updated to something like /\bcol-(\w+)-(\d)\b/ and sub replaced with gsub.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions