Skip to content

Commit 5c5d0e7

Browse files
authored
Merge pull request #454 from matestack/20200824_update-essential-guides
Update essential guides and introduce more guides
2 parents b164077 + 413d845 commit 5c5d0e7

28 files changed

+999
-956
lines changed

app/helpers/matestack/ui/core/application_helper.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ module ApplicationHelper
1414
def self.included(base)
1515
base.extend(ClassMethods)
1616
end
17+
1718
module ClassMethods
1819
def matestack_app _class
1920
@matestack_app_class = _class

docs/coming_soon.png

51.1 KB
Loading

docs/guides/1-installation/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ Require 'matestack-ui-core' in your `app/assets/stylesheets/application.css`
6969

7070
Since `0.7.5`, matestack-ui-core is compatible with activated [turbolinks](https://github.com/turbolinks/turbolinks).
7171

72-
We recommend to (remove/deactivate)(https://stackoverflow.com/a/38649595) turbolinks, as there is no real reason to use it alongside matetack-ui-core UI dynamics 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.
72+
We recommend to (remove/deactivate)(https://stackoverflow.com/a/38649595) turbolinks, as there is no reason to use it alongside matestack-ui-core UI dynamics 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.
7373

7474
## Matestack Folder
7575

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# Active Storage
22

3-
In Progress...
3+
![Coming Soon](../../coming_soon.png)

docs/guides/2-essential/00_introduction.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# Getting Started with Matestack
22

3+
Demo: [Matestack Demo](https://demo.matestack.io)<br>
4+
Github Repo: [Matestack Demo Application](https://github.com/matestack/matestack-demo-application)
5+
36
## Guide Assumptions
47

58
This guide is designed for Ruby on Rails beginners, advanced and experienced developers. We assume that you have basic knowledge about how Ruby on Rails routing and action controllers work. In this series of guides we will cover the basic principles and usage of matestack and further down the road introduce more complex principles and example use cases.
@@ -30,13 +33,15 @@ To enable you to write your apps, pages and components in Ruby, matestack provid
3033

3134
#### `Matestack::Ui::Component`'s
3235

33-
For nearly all existing HTML5 Tags there is a component in order to create a ui element with this tag. Visit the [components API documentation](docs/api/2-components/) for more information about `Matestack::Ui::Component`'s.
36+
For nearly all existing HTML5 Tags there is a component in order to create a ui element with this tag. Visit the [components API documentation](/docs/api/2-components/) for more information about `Matestack::Ui::Component`'s.
3437

3538
#### `Matestack::Ui::VueJsComponent`'s
3639

37-
VueJsComponents are more complex components. These always have a Vue.js counterpart and enable easy development of dynamic ui elements which would usually require you to write javascript code. VueJsComponents provide an abstraction so you don't have to write javascript code and instead create rich interfaces in Ruby. Visit the [components API documentation](docs/api/2-components/) for more information about `Matestack::Ui::VueJsComponent`'s.
40+
VueJsComponents are more complex components. These always have a Vue.js counterpart and enable easy development of dynamic ui elements which would usually require you to write javascript code. VueJsComponents provide an abstraction so you don't have to write javascript code and instead create rich interfaces in Ruby. Visit the [components API documentation](/docs/api/2-components/) for more information about `Matestack::Ui::VueJsComponent`'s.
3841

3942
## Recap & outlook
4043

4144
We introduced you to the apps, pages and components concepts of matestack. In order to unterstand better how matestack works, we create an application from the ground up using matestack and enhancing it step by step while leveraging more and more features of matestack.
4245
Read the following guides to get started with matestack and get a better understanding about how apps, pages, components work.
46+
47+
Let's setup a rails app with matestack by following the [next guide](/docs/guides/2-essential/01_setup.md)

docs/guides/2-essential/01_setup.md

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# Essential Guide 1: Setup
22

3+
Demo: [Matestack Demo](https://demo.matestack.io)<br>
4+
Github Repo: [Matestack Demo Application](https://github.com/matestack/matestack-demo-application)
5+
36
Welcome to the first part of our essential guide about building a web application with matestack.
47

58
## Introduction
@@ -22,10 +25,18 @@ To follow along, make sure you have successfully installed
2225
In the terminal, create a new Rails app by running
2326

2427
```sh
25-
rails new matestack-demo-application
28+
rails new matestack-demo-application --skip-turbolinks
2629
```
2730

28-
and switch into the newly created project via
31+
We skip turbolinks, because matestack has it's own loading api which makes turbolinks unnecessary. Using turbolinks in a matestack application can result in unwanted behavior and errors.
32+
33+
<details>
34+
<summary>Remove turbolinks if installed</summary>
35+
We encourage you to remove turbolinks if it's installed. To do so remove the line <code>gem 'turbolinks', '~> 5'</code> from your Gemfile and remove <code>require("turbolinks").start()</code> from the <code>app/javascript/packs/application.js</code> file. To clean things up remove the two <code>"data-turbolinks-track": "reload"</code> key/value pairs from your <code>app/views/application.html.erb</code>.
36+
</details>
37+
<br/>
38+
39+
Switch into the newly created project via
2940

3041
```sh
3142
cd matestack-demo-application
@@ -83,8 +94,8 @@ And add an element with the id `matestack_ui` to your layout, by changing your `
8394
<%= csrf_meta_tags %>
8495
<%= csp_meta_tag %>
8596

86-
<%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %>
87-
<%= javascript_pack_tag 'application', 'data-turbolinks-track': 'reload' %>
97+
<%= stylesheet_link_tag 'application', media: 'all' %>
98+
<%= javascript_pack_tag 'application' %>
8899
</head>
89100

90101
<body>

docs/guides/2-essential/02_active_record.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# Essential Guide 2: ActiveRecord & Database
22

3+
Demo: [Matestack Demo](https://demo.matestack.io)<br>
4+
Github Repo: [Matestack Demo Application](https://github.com/matestack/matestack-demo-application)
5+
36
Welcome to the second part of our essential guide about building a web application with matestack.
47

58
## Introduction

docs/guides/2-essential/03_index_show_transition.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# Essential Guide 3: Person Index, Show, Transition
22

3+
Demo: [Matestack Demo](https://demo.matestack.io)<br>
4+
Github Repo: [Matestack Demo Application](https://github.com/matestack/matestack-demo-application)
5+
36
Welcome to the third part of our essential guide about building a web application with matestack.
47

58
## Introduction
@@ -125,7 +128,7 @@ When you want to change between different pages within the same `matestack` app,
125128

126129
For links that go outside your `matestack` app, require a full page reload or reference URLs outside your domain, make sure to use the [link component](/docs/api/2-components/link.md) instead!
127130

128-
To learn more, check out the [complete API documentation](docs/api/2-components/transition.md) for the `transition` component.
131+
To learn more, check out the [complete API documentation](/docs/api/2-components/transition.md) for the `transition` component.
129132

130133
## Local testing
131134

docs/guides/2-essential/04_forms_edit_new_create_update_delete.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# Essential Guide 4: Forms & Actions (Create, Update, Delete)
22

3+
Demo: [Matestack Demo](https://demo.matestack.io)<br>
4+
Github Repo: [Matestack Demo Application](https://github.com/matestack/matestack-demo-application)
5+
36
Welcome to the fourth part of our essential guide about building a web application with matestack.
47

58
## Introduction
@@ -169,7 +172,7 @@ The 'success' key let's us define a behavior when the form was submitted success
169172
Inside our form component we have calls to normal html components like `label, br, button` which render the corresponding html tag and we have calls for form inputs and a form submit. Let's take a closer look at the `form_input` call. A form input at least requires a key and a type. The type can be any html input type possible. The key defines the input name as which it will get submitted. If the model specified by the `for` key in the form config responds to the key the input will be prefilled with the value the model returns. `form_radio, form_select, form_checkbox` helpers can take an array or hash in the `options` key. They render for example a radio button for each option in the array or hash. In case of an array the label and value are the same for each radio button, in case of a hash the keys are used as labels and the values as values.
170173
To enable the user to submit the form, we added a button to click. This button needs to be wrapped inside a `form_submit` call, which will take care of triggering the form submit if the contents inside the given block is clicked.
171174

172-
To learn more, check out the [complete API documentation](docs/api/2-components/form.md) for the `form` component.
175+
To learn more, check out the [complete API documentation](/docs/api/2-components/form.md) for the `form` component.
173176

174177
Take a moment to familiarize yourself with everything going on and then go ahead and create another page in `app/matestack/demo/pages/persons/edit.rb`, featuring similar content:
175178

@@ -240,7 +243,7 @@ Beyond that, here's some suggestions of what you could try to add in the future:
240243
- using other Ruby objects than ActiveRecord collections
241244
- fetching data from and sending data to third party APIs
242245

243-
To learn more, check out the [complete API documentation](docs/api/2-components/form.md) for the `form` component.
246+
To learn more, check out the [complete API documentation](/docs/api/2-components/form.md) for the `form` component.
244247

245248
## Adding a delete button for persons
246249

@@ -290,7 +293,7 @@ Beyond that, here's some suggestions of what you could try to add in the future:
290293
- sending an advanced payload with the HTTP request
291294
- re-rendering parts of a page on successful request
292295

293-
To learn more, check out the [complete API documentation](docs/api/2-components/action.md) for the `action` component.
296+
To learn more, check out the [complete API documentation](/docs/api/2-components/action.md) for the `action` component.
294297

295298
## Local testing
296299

docs/guides/2-essential/05_toggle_component.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# Essential Guide 5: Toggle Component
22

3+
Demo: [Matestack Demo](https://demo.matestack.io)<br>
4+
Github Repo: [Matestack Demo Application](https://github.com/matestack/matestack-demo-application)
5+
36
Welcome to the fifth part of our essential guide about building a web application with matestack.
47

58
## Introduction

0 commit comments

Comments
 (0)