Michael @ Work :: Space

Upgrading Rails Foundation from version 5 to 6 (with Flexbox enabled)

Just updated Foundation framework in my Rails app and here is how it can be done.

PART 1: Updating foundation-rails gem

1) save your current project state (i.e. git commit)
2) gem update

bundle update foundation-rails
...
Using foundation-rails 6.2.3.0 (was 5.5.3.2)

3) install foundation framework

\\ run it with -p first time. This way you can see what files in your project will be overwritten and what are the exact changes 
\\ so you can change them back accordingly after the update. Skip --slim option if you are not using slim
rails g foundation:install --slim -p
rails g foundation:install --slim

4) in application.css.scss should be:

@import "foundation_and_overrides"

5) in foundation_and_overrides.scss should be:

@import 'settings';
@import 'foundation';

6) restore changes in your application.html.slim file

PART 2: Enabling Flexbox

1) In _settings.scss:

$global-flexbox: true;

2) In foundation_and_overrides.scss

// @include foundation-grid;
@include foundation-flex-grid;
@include foundation-flex-classes;

And that's it. Then you should update all your foundation layouts and css files to keep up with the changes of the Foundation 6