Installation & Update

Installation

Make sure to install and get to know matestack-ui-core and matestack-ui-vuejs first!

Add 'matestack-ui-bootstrap' to your Gemfile

gem 'matestack-ui-bootstrap', "~> 3.1.0"

and run

$ bundle install

Matestack Ui Core/VueJs install steps (if not already happened)

Create a folder called 'matestack' in your app directory. All your Matestack apps, pages and components will be defined there.

$ mkdir app/matestack

Add the Matestack helper to your controllers. If you want to make the helpers available in all controllers, add it to your 'ApplicationController' this way:

app/controllers/application_controller.rb

class ApplicationController < ActionController::Base
  include Matestack::Ui::Core::Helper
  #...
end

You need to add the ID "matestack-ui" to some part of your application layout (or any layout you use). That's required for Matestack's Vue.js to work properly!

For Example, your app/views/layouts/application.html.erb should look like this:

circle-exclamation
circle-check

JavaScript installation

Webpacker > 5.x based JavaScript installation

JS via Webpackerchevron-right

Rails 7 importmap based installation

JS via Importmapchevron-right

JSBundling-Rails based installation

JS via JSBundling-Railschevron-right

Icons setup

circle-exclamation

Download and import Bootstraps icons:

app/assets/images/icons

Stylesheet Setup

Option 1: Via CDN (CSS only)

circle-info

This option makes sense if you're using the importmap approach for the JS setup and are looking for a minimal setup in order to pull in the required styles. You cannot use SCSS features though.

app/views/layout.html.erb

Please adjust the version numbers to your needs. They should match the JavaScript package versions used in the importmap config.

Option 2a : Importmap + Sprockets/SassC (SCSS without node and yarn)

circle-info

This option makes sense if you're using the importmap approach for the JS setup and are looking for a minimal setup without node and yarn involved in order to pull in the required styles and use SCSS features.

Install the bootstrap gem

Add the asset path to config/initializers/assets.rb

Import the scss files in your app/assets/stylesheets/application.scss

Option 2b : Importmap + CSSBundling-Rails

circle-info

Use this option if you have installed the JavaScript packages via Importmap and want to use SCSS features like Bootstrap theming

Install cssbundling-rails

Like documented here: https://github.com/rails/cssbundling-railsarrow-up-right

And then add matestack-ui-bootstrap:

Afterwards make sure your package.json looks something like that:

package.json

Even if you use the importmap approach, this package.json will install the JavaScript packages into the node_modules folder. They will not be used when following the importmap approach. Only the (S)CSS files will be used in this case.

And finally adjust the app/assets/stylesheets/application.bootstrap.scss to look like:

and run your server and css builder with

Option 2c : JSBundling-Rails + CSSBundling-Rails

circle-info

Use this option if you have installed the JavaScript packages via JSBundling-Rails and want to use SCSS features like Bootstrap theming

not tested yet

Option 3: Via Webpacker (SCSS)

circle-info

Use this option if you have installed the JavaScript packages via Webpacker as well in order to be able to use SCSS features like Bootstrap theming

Tell Webpack to import Bootstraps CSS:

app/javascript/packs/stylesheets/application.scss

app/javascript/packs/application.js

and compile with:

Update

circle-exclamation

Ruby Gem

Depending on the entry in your Gemfile, you might need to adjust the allowed version ranges in order to update the Gem. After checked and adjusted the version ranges, run:

and then check the installed version:

JavaScript Package via Yarn

If you've installed the JavaScript dependecies via Yarn/Webpacker you need to update the JavaScript assets via yarn:

and finally check if the correct version is installed:

circle-exclamation

Last updated