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

Don't use `concat` when not necessary #660

Closed lcreid closed 1 year ago

lcreid commented 1 year ago

ActionView::Helpers::TextHelper#concat is not recommended for use, and was leading to some confusing results while I was trying to refactor for #642 .

This PR removes concat from the code, except where it was needed in some test cases. (And perhaps there's a way to get rid of it from the test cases, too, but I didn't investigated it.) In the test cases, we now use ActionView::Helpers::TextHelper#concat consistently.

This PR also replaces String#+= with String#<< since the internet says the String#<< is much faster.