You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
2.[Integration in existing projects](#integration-in-existing-projects)
14
+
15
+
## Installation
6
16
7
17
Add 'matestack-ui-core' to your Gemfile
8
18
@@ -16,13 +26,13 @@ and run
16
26
$ bundle install
17
27
```
18
28
19
-
## JavaScript
29
+
###JavaScript Setup
20
30
21
31
Matestack uses JavaScript and, in particular, [vuejs](http://vuejs.org). To include these into your existing rails app, matestack supports both, [webpack](https://webpack.js.org/)([er](https://github.com/rails/webpacker/)) and the [asset pipeline](https://guides.rubyonrails.org/asset_pipeline.html).
22
32
23
33
Rails 6+ apps use webpacker by default. Rails 5 and below apps use the asset pipeline by default.
24
34
25
-
### Webpacker
35
+
####Webpacker
26
36
27
37
Add 'matestack-ui-core' to your `package.json` by running:
28
38
@@ -47,7 +57,7 @@ $ bin/webpack
47
57
48
58
When you update the matestack-ui-core gem, make sure to update the npm package as well.
49
59
50
-
### Asset Pipeline
60
+
####Asset Pipeline
51
61
52
62
If you are using the asset pipeline, you don't need to install the separate npm package. All required javascript libraries are provided by the matestack-ui-core gem.
53
63
@@ -57,16 +67,16 @@ Require 'matestack-ui-core' in your `app/assets/javascript/application.js`
57
67
//= require matestack-ui-core
58
68
```
59
69
60
-
### Turbolinks
70
+
####Turbolinks
61
71
62
72
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.
63
73
64
-
## Matestack Folder
74
+
###Matestack Folder
65
75
66
76
Create a folder called 'matestack' in your app directory. All your matestack apps,
67
77
pages and components will be defined there.
68
78
69
-
##Include Helper
79
+
### Controller Setup
70
80
71
81
Add the matestack helper to your controllers. If you want to make the helpers
72
82
available in all controllers, add it to your 'ApplicationController' this way:
@@ -80,7 +90,7 @@ class ApplicationController < ActionController::Base
80
90
end
81
91
```
82
92
83
-
## Application Layout
93
+
###Application layout adjustments
84
94
85
95
You need to add the ID "matestack-ui" to some part of your application layout (or any layout you use)
86
96
@@ -113,12 +123,26 @@ For Example, your `app/views/layouts/application.html.erb` should look like this
113
123
Don't apply the "matestack-ui" id to the body tag.
114
124
115
125
116
-
## Websocket Integration
126
+
###Websocket Integration
117
127
118
128
If you want to use websockets, please read our [action cable](/docs/guides/1000-action_cable/) guide.
119
129
120
-
## That's it!
130
+
131
+
### That's it!
121
132
122
133
That's all you need to setup matestack!
123
134
124
135
For further reading check out the [basic building blocks](/docs/guides/200-basic_building_blocks/) or get started with the [tutorial](/docs/guides/100-tutorial/) and create your first matestack app.
136
+
137
+
138
+
## Usage
139
+
140
+
There are two ways to use matestack.
141
+
142
+
### Full matestack
143
+
144
+
First, as we call it, _full matestack_, enabling all features and developing with all benefits. Learn more about the _full matestack_ approach by following the [tutorial](/docs/guides/100-tutorial/README.md) or reading about matestacks [basic building blocks](/docs/guides/200-basic_building_blocks/README.md).
145
+
146
+
### Integration in existing projects
147
+
148
+
Secondly integrating matestack in your existing rails application. Building custom components and replacing/migrating/refactoring your views step by step to use matestack. Rendering your custom components can be achieved with the `matestack_component` helper available in views. For example `<%= matestack_component(:user_stats, user: user) %>`. It is also possible to use existing `haml` views with components or render rails views inside a page. Read more about how to integrate matestack into existing projects in our [Rails integration guide](/docs/guides/300-rails-integration/README.md).
0 commit comments