bootstrap-ruby / bootstrap_form

Official repository of the bootstrap_form gem, a Rails form builder that makes it super easy to create beautiful-looking forms using Bootstrap 5.
MIT License
1.64k stars 351 forks source link

Add support for append and prepend on collection_select (fixes #428) #641

Closed judylovesruby closed 2 years ago

judylovesruby commented 2 years ago

Hello, thanks a lot for creating this gem! Today I would have needed a collection_select with prepend and noticed that this does not work yet. Here's a fix for it. I hope everything's alright and would be happy if it got merged :slightly_smiling_face: Best, Judith

judylovesruby commented 2 years ago

I don't consider myself a poweruser of bootstrap or bootstrap_form, so I'm not sure. But the only thing I found now was grouped_collection_select, which you mention in the linked issue. At least for the selects there are examples in the Bootstrap 5 documentation: https://getbootstrap.com/docs/5.0/forms/input-group/ . And the "ordinary" select of bootstrap_form already handles prepend and append :)

lcreid commented 2 years ago

Great. Thanks for looking into this. I'll merge this shortly.

Thanks for your patience. I don't actually use this gem at the moment, so it always takes me a while to get back up to speed. Thank you for you support and efforts to improve the gem.

judylovesruby commented 2 years ago

Thanks for merging this @lcreid! I saw you also did some other changes lately. Do you plan to release more changes together?

lcreid commented 2 years ago

I was trying to get another change in, but obviously I haven't managed that yet. I'll try to do a release soon, but in the meantime you can temporarily change your Gemfile to use this:

gem "bootstrap_form", git: "https://github.com/bootstrap-ruby/bootstrap_form.git", branch: "main"

Thanks for your patience, and your PR. We really appreciate your contribution.

judylovesruby commented 2 years ago

Okay, thanks for letting me know :slightly_smiling_face: I usually prefer not to include links to repositories in the Gemfile, since then bundler-audit will not be able to warn me in case of CVEs. But I can do it as temporary workaround.

lcreid commented 2 years ago

That's a good point. I managed to release version 5.1, including your PR, yesterday. Thanks again for your contribution!

judylovesruby commented 2 years ago

Thank you :slightly_smiling_face: