Skip to content

Commit 9579f6a

Browse files
apply jonas' requested changes
1 parent 7814e52 commit 9579f6a

File tree

4 files changed

+10
-16
lines changed

4 files changed

+10
-16
lines changed

docs/tooling_and_ecosystem/generators/matestack_page_generator.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ Generates matestack pages to `app/matestack/pages`.
66

77
## Parameters
88

9-
**NAME** - Mandatory. Creates an empty matestack component in `app/matestack/components/NAME.rb`.
9+
**NAME** - Mandatory. Creates an empty matestack page in `app/matestack/pages/NAME.rb`.
1010

1111
**--app_name** - Mandatory. Adds a `/app_name` folder to `app/matestack/pages` to indicate to which matestack app the pages belongs. Pages _do not necessarily need to belong to an app_, but for now the page scaffolder can only provide this functionality.
1212

13-
**--namespace** - Optional. Adds a `/namespace` folder within the `/app_name` and a namespace to the `page.rb`.
13+
**--namespace** - Optional. Adds a `/namespace` folder within the `/app_name` and a namespace to the `page.rb`. You can also scope the namespace using additional `/`'s like so: `namespace_1/namespace_2`
1414

1515
**--controller_action** - Optional. Takes a `controller#action` to use in the created route for the page. If not provided, a `controller#action` is created from **NAME** and **--app_name**.
1616

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
.<%= file_name %>{@tag_attributes}
2-
%p
2+
%div
33
This is your custom <%= class_name %> component
44
- if block_given?
55
= yield
Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,17 @@
1+
// Require your custom component in your application.js before usage
2+
// Place it below "//= require matestack-ui-core" using the following line:
3+
//= require <% unless @namespace.nil? %><%= @namespace %>/<% end %><%= file_name %>
4+
15
MatestackUiCore.Vue.component('custom<% unless @namespace.nil? %>-<%= @namespace %><% end %>-<%= file_name %>', {
26
mixins: [MatestackUiCore.componentMixin],
3-
data() {
7+
data: function() {
48
return {
5-
data: []
9+
foo: 'bar'
610
};
711
},
812
methods: {},
913
mounted: function(){
14+
// this is your completeness check and should be deleted before deployment
1015
console.log('Custom Dynamic Component <%= class_name %> mounted!')
1116
}
1217
});

lib/generators/matestack_page/templates/matestack_page.erb

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,4 @@ def response
1212
}
1313
end
1414

15-
# OPTIONAL: Partials come after the response
16-
# def partial_one
17-
# partial {
18-
# # your components go here
19-
# }
20-
# end
21-
22-
# OPTIONAL: Slots come after partials
23-
# def slots
24-
# end
25-
2615
end

0 commit comments

Comments
 (0)