简体   繁体   中英

how to upgrade simple_form gem for bootstrap 3

I updated my application by moving to bootstrap 3 from version 2 by replacing the css files etc.

I thought I'd upgrade simple_from as well since the old one is probably incompatible with bootstrap 2.

So I ran bundle update simple_form and it upgraded from simple_form (2.0.4) to (2.1.1).

How do I upgrade to the lastest version? and how do I integrate it with bootstrap 3? Do I need to reinstall simple_form using rails generate simple_form:install --bootstrap instead of updating the gem with bundler ? and how come updating the gem didn't update to the latest one?

Thank you for the clarifications on how to migrate simple_form properly.

Bootstrap 3 support for simple_form has not made it into a stable release yet. You can read more here . If you want to install the rc version, which seems to work fine, simply use gem 'simple_form', '~> 3.1.0.rc1' in the Gemfile. (Run bundle install after making the change)

I'm not sure how simple_form generators work, but one way of making sure the configuration is updated is by copying config files from the sample application . The files are config/initializers/simple_form.rb and config/initializers/simple_form_bootstrap.rb .

If there are other simple_form-related files leftover from the previous version, you should probably delete them.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM