We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Currently the gem allows to insert custom markup using a form_group helper with this syntax
form_group
<!-- Radio buttons --> <%= f.form_group :type, label: {text: 'Type'} do %> <%= f.radio_button :type, type_1, inline: true, label: type_1.titleize %> <%= f.radio_button :type, type_2, inline: true, label: type_2.titleize %> <% end %> <!-- Country selector --> <%= f.form_group :country_code, label: {text: 'Country'} do %> <%= f.country_select :country_code, {include_blank: true}, class: 'form-control' -%> <% end %>
Text inputs (and also other "native" inputs) won't accept a block, i.e.
<%= f.text_field :title %>
produces this HTML
<div class="form-group"> <label class="control-label col-sm-2 required" for="item_title">Title</label> <div class="col-sm-10"> <input class="form-control" type="text" name="item[title]" id="item_title" /> </div> </div>
It would be nice and useful to build complex forms to have this
<%= f.text_field :title do %> <div class="anything">Foo bar</div> <%- end -%>
to get this HTML
<div class="form-group"> <label class="control-label col-sm-2 required" for="item_title">Title</label> <div class="col-sm-10"> <input class="form-control" type="text" name="item[title]" id="item_title" /> <!-- Block output goes here --> <div class="anything">Foo bar</div> </div> </div>
The text was updated successfully, but these errors were encountered:
👍 This would really help with custom bootstrap layouts and plugins that require to have some custom markup.
Sorry, something went wrong.
👍 For more complex form-groups this would be great.
Yes this would be great. I am running into this limitation when trying to custom markup radio buttons and checkboxes.
Update: It turns out that check boxes support this already: https://github.com/bootstrap-ruby/rails-bootstrap-forms/blob/master/lib/bootstrap_form/form_builder.rb#L101. I suppose the same approach can be take to implement it for radio buttons.
No branches or pull requests
Currently the gem allows to insert custom markup using a
form_group
helper with this syntaxText inputs (and also other "native" inputs) won't accept a block, i.e.
produces this HTML
It would be nice and useful to build complex forms to have this
to get this HTML
The text was updated successfully, but these errors were encountered: