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
Copy file name to clipboardExpand all lines: docs/install/README.md
+67-10Lines changed: 67 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,6 @@
1
1
# Install
2
2
3
-
If your're using the classic Rails assets pipeline, this guide shows you how to
4
-
add matestack to your Rails app.
3
+
This guide shows you how to add matestack-ui-core to an existing rails application.
5
4
6
5
## Gemfile
7
6
@@ -19,15 +18,56 @@ $ bundle install
19
18
20
19
## Javascript
21
20
22
-
Require 'matestack-ui-core' in your `assets/javascript/application.js`
21
+
Matestack uses javascripts 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
+
23
+
Rails 6+ apps, by default, use webpacker, rails 5 apps, by default, use the asset pipeline.
24
+
25
+
### Webpacker
26
+
27
+
Add 'matestack-ui-core' to your `package.json` by running:
This adds the npm package that provides the javascript files corresponding to matestack-ui-core ruby gem. Make sure that the npm package version matches the gem version. To find out what gem version you are using, you may use `bundle info matestack-ui-core`.
35
+
36
+
Next, import 'matestack-ui-core' in your `app/javascript/packs/application.js`
37
+
38
+
```js
39
+
importMatestackUiCorefrom'matestack-ui-core'
40
+
```
41
+
42
+
and compile the javascript code with webpack:
43
+
44
+
```
45
+
$ bin/webpack
46
+
```
47
+
48
+
When, in the future, you update the matestack-ui-core gem, make also sure to update the npm package as well.
49
+
50
+
### Asset Pipeline
51
+
52
+
If you are not using webpacker but the asset pipeline, you don't need to install a separate npm package. All required javascript libraries including vuejs are provided by matestack-ui-core ready-to-use via the asset pipeline.
53
+
54
+
Require 'matestack-ui-core' in your `app/assets/javascript/application.js`
23
55
24
56
```javascript
25
57
//= require matestack-ui-core
26
58
```
27
-
Note:
28
59
29
-
-**Remove turbolinks! Currently, matestack can't be used with turbolinks. This will be fixed soon**
30
-
- Additional Webpacker integration is coming soon
60
+
Require 'matestack-ui-core' in your `app/assets/stylesheets/application.css`
61
+
62
+
```css
63
+
/*
64
+
*= require matestack-ui-core
65
+
*/
66
+
```
67
+
68
+
### Turbolinks Coming Soon
69
+
70
+
At the moment, matestack-ui-core is not compatible with [turbolinks](https://github.com/turbolinks/turbolinks). Please remove or deactive turbolinks for now. We are working on turbolinks support and will add it soon. ([Issue #232](https://github.com/matestack/matestack-ui-core/issues/232))
31
71
32
72
## Matestack Folder
33
73
@@ -54,7 +94,7 @@ You need to add the ID "matestack_ui" to some part of your application layout (o
54
94
55
95
For Example, your `app/views/layouts/application.html.erb` should look like this:
56
96
57
-
```html+erb
97
+
```erb
58
98
<!DOCTYPE html>
59
99
<html>
60
100
<head>
@@ -63,6 +103,11 @@ For Example, your `app/views/layouts/application.html.erb` should look like this
0 commit comments