Skip to content

Commit 9f72d36

Browse files
author
Nils Henning
committed
[TASK] extend installation guide
1 parent 171bc79 commit 9f72d36

File tree

1 file changed

+35
-11
lines changed

1 file changed

+35
-11
lines changed

docs/guides/000-installation/README.md

Lines changed: 35 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,18 @@
1-
# Installation
1+
# Installation Guide
22

33
This guide shows you how to add matestack-ui-core to an existing rails application.
44

5-
## Gemfile
5+
1. [Installation](#installation)
6+
1. [JavaScript Setup](#javascript-setup)
7+
2. [Matestack Folder](#matestack-folder)
8+
3. [Controller Setup](#controller-setup)
9+
4. [Application layout adjustments](#application-layout-adjustments)
10+
5. [Websocket Integration](#websocket-integration)
11+
2. [Usage](#usage)
12+
1. [Full matestack](#full-matestack)
13+
2. [Integration in existing projects](#integration-in-existing-projects)
14+
15+
## Installation
616

717
Add 'matestack-ui-core' to your Gemfile
818

@@ -16,13 +26,13 @@ and run
1626
$ bundle install
1727
```
1828

19-
## JavaScript
29+
### JavaScript Setup
2030

2131
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).
2232

2333
Rails 6+ apps use webpacker by default. Rails 5 and below apps use the asset pipeline by default.
2434

25-
### Webpacker
35+
#### Webpacker
2636

2737
Add 'matestack-ui-core' to your `package.json` by running:
2838

@@ -47,7 +57,7 @@ $ bin/webpack
4757

4858
When you update the matestack-ui-core gem, make sure to update the npm package as well.
4959

50-
### Asset Pipeline
60+
#### Asset Pipeline
5161

5262
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.
5363

@@ -57,16 +67,16 @@ Require 'matestack-ui-core' in your `app/assets/javascript/application.js`
5767
//= require matestack-ui-core
5868
```
5969

60-
### Turbolinks
70+
#### Turbolinks
6171

6272
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.
6373

64-
## Matestack Folder
74+
### Matestack Folder
6575

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

69-
## Include Helper
79+
### Controller Setup
7080

7181
Add the matestack helper to your controllers. If you want to make the helpers
7282
available in all controllers, add it to your 'ApplicationController' this way:
@@ -80,7 +90,7 @@ class ApplicationController < ActionController::Base
8090
end
8191
```
8292

83-
## Application Layout
93+
### Application layout adjustments
8494

8595
You need to add the ID "matestack-ui" to some part of your application layout (or any layout you use)
8696

@@ -113,12 +123,26 @@ For Example, your `app/views/layouts/application.html.erb` should look like this
113123
Don't apply the "matestack-ui" id to the body tag.
114124

115125

116-
## Websocket Integration
126+
### Websocket Integration
117127

118128
If you want to use websockets, please read our [action cable](/docs/guides/1000-action_cable/) guide.
119129

120-
## That's it!
130+
131+
### That's it!
121132

122133
That's all you need to setup matestack!
123134

124135
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

Comments
 (0)