Add 'matestack-ui-core' to your Gemfile
$ bundle install
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:
class ApplicationController < ActionController::Baseinclude Matestack::Ui::Core::ApplicationHelper#...end
Now, you are able to create UI components in pure Ruby and use them in your Rails views. Additionally you can substitute Rails views and layouts with Matestack pages and apps.
If you want to use Matestack's optional reactivity features in pure Ruby (through dynamic Vue.js components such as
Add 'matestack-ui-core' to your
package.json by running:
$ yarn add matestack-ui-core
bundle info matestack-ui-core.
Next, import 'matestack-ui-core' in your
import MatestackUiCore from 'matestack-ui-core'
$ bin/webpack --watch
matestack-ui-core in your
//= require matestack-ui-core
We recommend to (remove/deactivate)(https://stackoverflow.com/a/38649595) turbolinks, as there is no reason to use it alongside matestack-ui-core and there might appear some strange side effects. If you encounter strange page-transition/form-submit/action-submit behavior and have turbolinks activated, try to deactivate it first.
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:
Some of Matestack's reactive core components may be used with or require ActionCable. If you want to use ActionCable, please read the action cable guide:
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:
bundle update matestack-ui-core
and then check the installed version:
bundle info matestack-ui-core
yarn update matestack-ui-core
and finally check if the correct version is installed:
yarn list --pattern "matestack-ui-core"