simple_form icon indicating copy to clipboard operation
simple_form copied to clipboard

Simple_form generator for Bootstrap 5 problem

Open hoangdd opened this issue 2 years ago • 1 comments

Environment

  • Ruby [2.7.5]
  • Rails [7.0.3.1]
  • Simple Form [5.1.0]
  • Bootstrap gem [5.2.0]

Current behavior

After running rails generate simple_form:install --bootstrap, I got initializer config config/initializers/simple_form_bootstrap.rb file look likes Bootstrap 4 compatible configuration( with .form-group wrapper ). Screen Shot 2022-08-03 at 2 56 05 PM

And the HTML output with .form-group wrapper.

Screen Shot 2022-08-03 at 2 59 30 PM

Expected behavior

Expecting generator can create config file with bootstrap 5 support content. Same as example at simple_form-bootstrap/blob/main/config/initializers/simple_form_bootstrap.rb

Problem demo

https://github.com/hoangdd/simple_form_demo

Thanks for your amazing work.

hoangdd avatar Aug 03 '22 06:08 hoangdd

Encountered this as well. Looks like the released gem contains an outdated generator for bootstrap.

My temporary working

  1. Change the Gemfile entry to gem "simple_form", github: "heartcombo/simple_form", branch: "main"
  2. bundle install
  3. rails generate simple_form:install --bootstrap
  4. Change the Gemfile entry back to gem "simple_form"
  5. bundle install

spilth avatar Aug 08 '22 16:08 spilth

Yes, Bootstrap 5 is not released yet. You can use what @spilth suggested for now, thanks!

nashby avatar Sep 18 '22 15:09 nashby

This appears to still be an issue, I've just hit it with the latest version from RubyGems, and fixed it with this method. Is this known?

trevorfoxsoft avatar Jan 06 '23 17:01 trevorfoxsoft