heartcombo / simple_form

Forms made easy for Rails! It's tied to a simple DSL, with no opinion on markup.
http://blog.plataformatec.com.br/tag/simple_form
MIT License
8.22k stars 1.32k forks source link

Update install generator for Bootstrap 5 #1738

Closed mhw closed 2 years ago

mhw commented 3 years ago

This syncs up the generator template with the new one from simple_form-bootstrap.

There's a minor issue with the styling of validation errors in input groups that I'd like to look at, but I don't think we need to wait for that before merging this in.

/cc @m5o

m5o commented 3 years ago

👀 https://github.com/heartcombo/simple_form/pull/1729 maybe could become interesting with the issue around .has-validation for input groups

oTiMo commented 3 years ago

Thank you for this PR !

oTiMo commented 3 years ago

When do you think this branch will be merged?

o-t-w commented 3 years ago

So this gem doesn't use Bootstrap 5 by default? How do I use Bootstrap 5 with this gem?

carlosantoniodasilva commented 3 years ago

@o-t-w we don't have this in the main repo yet, which is my fault for not having finished reviewing the change... I'll get to this soon.

Anyway, all you need is the initializer that comes with this PR, you should be able to copy it from the app where it's kept current: https://github.com/heartcombo/simple_form-bootstrap/blob/master/config/initializers/simple_form_bootstrap.rb (we just bundle the initializer with SF to make it simpler to install upfront)

collimarco commented 2 years ago

Nice to find this issue... I was really wondering what was wrong with my configuration, since the design was broken with Bootstrap 5 in a new app.

It seems that copying the new initializer solves most issues, Thanks!!

The only strange thing is that the btn is completely white (and it doesn't look like a button), maybe it should be set to btn-primary by default?

jamgregory commented 2 years ago

I've just come across this issue when generating a new Rails application that uses Bootstrap 5 and realising that Simple Form doesn't have Bootstrap 5 support yet.

@carlosantoniodasilva - I don't suppose you know when this might be merged in and released? :crossed_fingers:

nashby commented 2 years ago

@mhw thank you!