Installation & Update
Depenencies
matestack-ui-vuejs
requires matestack-ui-core
. Make sure to follow the install guide from https://docs.matestack.io/matestack-ui-core/getting-started/installation-update and understand the concepts of matestack-ui-core
.
Installation
Add 'matestack-ui-vuejs' to your Gemfile
and run
Matestack Ui Core 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.
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
Application layout adjustments
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:
Don't apply the "matestack-ui" id to the body tag.
v-cloak
is used to avoid to hide un-compiled Vuejs templates until they are ready when using a CSS rule like:
This is optional but highly recommended for a better UI experience. More info here: https://vuejs.org/api/built-in-directives.html#v-cloak
JavaScript installation
Webpacker > 5.x based JavaScript installation
Rails 7 importmap based JavaScript installation
JSBundling-Rails based JavaScript installation
Usage with Turbolinks
If you want to use matestack-ui-vuejs
alongside with Turbolinks or Turbo, please add:
And use following snippet instead:
Usage with Turbo
Not tested yet!
ActionCable Integration
Some of Matestack's reactive components may be used with or require ActionCable. If you want to use ActionCable, please read the action cable guide:
Update
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:
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:
The Ruby gem version and the npm package version should match!
Last updated