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/api/000-base/40-isolated_component.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -155,7 +155,7 @@ With `init_on` you can specify events on which the isolate components gets initi
155
155
156
156
#### public_options
157
157
158
-
You can pass data as a hash to your custom isolate component with the `public_options` option. This data is inside the isolate component accessible via a hash with indifferent access, for example `public_options[:item_id]`. All data contained in the `public_options` will be passed as json to the corresponding vue component, which means this data is visible on the client side as it is rendered in the vue component config. So be careful what data you pass into `public_options`!
158
+
You can pass data as a hash to your custom isolate component with the `public_options` option. This data is inside the isolate component accessible via a hash with indifferent access, for example `public_options[:item_id]`. All data contained in the `public_options` will be passed as json to the corresponding Vue.js component, which means this data is visible on the client side as it is rendered in the Vue.js component config. So be careful what data you pass into `public_options`!
159
159
160
160
Due to the isolation of the component the data needs to be stored on the client side as to encapsulate the component from the rest of the UI.
161
161
For example: You want to render a collection of models in single components which should be able to rerender asynchronously without rerendering the whole UI. Since we do not rerender the whole UI there is no way the component can know which of the models it should rerender. Therefore passing for example the id in the public_options hash gives you the possibility to access the id in an async request and fetch the model again for rerendering. See below for examples.
@@ -346,7 +346,7 @@ With `init_on: 'init_time'` you can specify an event on which the isolated compo
346
346
347
347
### Example 6 - Use custom data in isolated components
348
348
349
-
Like described above it is possible to use custom data in your isolated components. Just pass them as a hash to `public_options` and use them in your isolated component. Be careful, because `public_options` are visible in the raw html response from the server as they get passed to a vue component.
349
+
Like described above it is possible to use custom data in your isolated components. Just pass them as a hash to `public_options` and use them in your isolated component. Be careful, because `public_options` are visible in the raw html response from the server as they get passed to a Vue.js component.
350
350
351
351
Lets render a collection of models and each of them should rerender when a user clicks a corresponding refresh button. Our model is called `Match`, representing a soccer match. It has an attribute called score with the current match score.
352
352
@@ -401,5 +401,5 @@ end
401
401
```
402
402
403
403
This page will render a match_isolated_score component for each match.
404
-
If one of the isolated components gets rerendered we need the id in order to fetch the correct match. Because the server only resolves the isolated component instead of the whole UI it does not know which match exactly is requested unless the client requests a rerender with the match id. This is why `public_options` options are passed to the client side vue component.
404
+
If one of the isolated components gets rerendered we need the id in order to fetch the correct match. Because the server only resolves the isolated component instead of the whole UI it does not know which match exactly is requested unless the client requests a rerender with the match id. This is why `public_options` options are passed to the client side Vue.js component.
405
405
So if match two should be rerendered the client requests the match_isolated_score component with `public_options: { id: 2 }`. With this information our isolated component can fetch the match and rerender itself.
Copy file name to clipboardExpand all lines: docs/api/100-components/form.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -932,9 +932,9 @@ end
932
932
933
933
```
934
934
935
-
## Form and other VueJs components
935
+
## Form and other Vue.js components
936
936
937
-
The child components `form_*` have to be placed within the scope of the parent `form` component, without any other VueJs component like `toggle`, `async` creating a new scope between the child component and the parent form component**
937
+
The child components `form_*` have to be placed within the scope of the parent `form` component, without any other Vue.js component like `toggle`, `async` creating a new scope between the child component and the parent form component**
Copy file name to clipboardExpand all lines: docs/guides/000-installation/README.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,7 +18,7 @@ $ bundle install
18
18
19
19
### JavaScript Setup
20
20
21
-
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).
21
+
Matestack uses JavaScript and, in particular, [Vue.js](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
22
23
23
Rails 6+ apps use webpacker by default. Rails 5 and below apps use the asset pipeline by default.
This adds the npm package that provides the javascript corresponding to the 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`.
34
+
This adds the npm package that provides the JavaScript corresponding to the 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
35
36
36
Next, import 'matestack-ui-core' in your `app/javascript/packs/application.js`
37
37
@@ -49,7 +49,7 @@ When you update the matestack-ui-core gem, make sure to update the npm package a
49
49
50
50
#### Asset Pipeline
51
51
52
-
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.
52
+
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
53
54
54
Require 'matestack-ui-core' in your `app/assets/javascript/application.js`
Copy file name to clipboardExpand all lines: docs/guides/100-tutorial/00_introduction.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,7 +10,7 @@ This guide is designed for Ruby on Rails beginners, advanced and experienced dev
10
10
11
11
## What is Matestack?
12
12
13
-
Matestack deeply integrates a Vue.js based UI into Ruby on Rails, offering prebuilt components. Use these prebuild components to write dynamic Web-UIs mostly in pure Ruby and with minimum effort. Matestack enables you to develop rich SPA like interfaces in no time and without touching javascript. And if you need to go deeper you can always create your own custom components to do so.
13
+
Matestack deeply integrates a Vue.js based UI into Ruby on Rails, offering prebuilt components. Use these prebuild components to write dynamic Web-UIs mostly in pure Ruby and with minimum effort. Matestack enables you to develop rich SPA like interfaces in no time and without touching JavaScript. And if you need to go deeper you can always create your own custom components to do so.
14
14
15
15
## Concept
16
16
@@ -38,11 +38,11 @@ For nearly all existing HTML5 Tags there is a component in order to create a ui
38
38
39
39
#### `Matestack::Ui::VueJsComponent`'s
40
40
41
-
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/100-components/) for more information about `Matestack::Ui::VueJsComponent`'s.
41
+
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/100-components/) for more information about `Matestack::Ui::VueJsComponent`'s.
42
42
43
43
## Recap & outlook
44
44
45
45
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.
46
46
Read the following guides to get started with matestack and get a better understanding about how apps, pages, components work.
47
47
48
-
Let's setup a rails app with matestack by following the [next guide](/docs/guides/100-tutorial/01_setup.md)
48
+
Let's setup a rails app with matestack by following the [next guide](/docs/guides/100-tutorial/01_setup.md)
Copy file name to clipboardExpand all lines: docs/guides/100-tutorial/06_async_component.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -65,7 +65,7 @@ But how can we easily update the list, when the delete action was successful? Re
65
65
66
66
## Rerender list when person is deleted
67
67
68
-
When a person is deleted an event is emitted, but nothing more happens, but we want to update the list of persons, so we no longer see the deleted person in the list. In order to achieve this we could write some javascript which would manipulate the dom or we can use matestacks `async` component and get the result we want in no time and without touching any javascript. Okay, so let's update our index page like this:
68
+
When a person is deleted an event is emitted, but nothing more happens, but we want to update the list of persons, so we no longer see the deleted person in the list. In order to achieve this we could write some JavaScript which would manipulate the dom or we can use matestacks `async` component and get the result we want in no time and without touching any JavaScript. Okay, so let's update our index page like this:
69
69
70
70
```ruby
71
71
classDemo::Pages::Persons::Index
@@ -125,6 +125,6 @@ git add . && git commit -m "add delete button to person list and update it dynam
125
125
126
126
## Recap & outlook
127
127
128
-
We added a delete button to our person list on the index page. When a person is deleted our list gets automatically updated without even reloading the page, just by updating the part that is needed. And all of that with a few lines of code and without writing any javascript.
128
+
We added a delete button to our person list on the index page. When a person is deleted our list gets automatically updated without even reloading the page, just by updating the part that is needed. And all of that with a few lines of code and without writing any JavaScript.
129
129
130
130
Take a well deserved rest and make sure to come back to the next part of this series, introducing [partials and custom components](/docs/guides/100-tutorial/07_partials_and_custom_components.md).
Copy file name to clipboardExpand all lines: docs/guides/100-tutorial/08_collection_async.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -208,7 +208,7 @@ Run `rails s` and head over to [localhost:3000](http://localhost:3000/) to and c
208
208
209
209
## Deep dive into the `collection` component
210
210
211
-
So we have come quite a way from simply displaying all the `person` records in a plain list, right? By making use of the `collection` component and adding the necessary configuration, the person index page content is now searchable, orderable and paginated! This would have required us to write a lot of javascript and a complex controller action, but with matestack `collection` component we could do it all just with a few lines of ruby.
211
+
So we have come quite a way from simply displaying all the `person` records in a plain list, right? By making use of the `collection` component and adding the necessary configuration, the person index page content is now searchable, orderable and paginated! This would have required us to write a lot of JavaScript and a complex controller action, but with matestack `collection` component we could do it all just with a few lines of ruby.
212
212
213
213
The `collection` component was created with exactly this use case in mind - you got a collection of data (e.g. from ActiveRecord) that needs to be displayed in a filterable, ordered and paginated fashion (list, table, cards) without forcing you to write a lot of (repetitive, yet complex) logic.
214
214
@@ -250,4 +250,4 @@ We learned how to use matestacks `collection` component to generate a filterable
250
250
251
251
So what's left? In the upcoming guides, you will create your own Vue.js components and learn about other topics like styling, notifications and authorization that are part of modern web applications
252
252
253
-
So stay tuned and, once ready, head over to the next part, covering [vue.js components](/docs/guides/100-tutorial/09_dynamic_components.md) for powerful custom components.
253
+
So stay tuned and, once ready, head over to the next part, covering [Vue.js components](/docs/guides/100-tutorial/09_dynamic_components.md) for powerful custom components.
0 commit comments