File tree Expand file tree Collapse file tree 2 files changed +49
-30
lines changed Expand file tree Collapse file tree 2 files changed +49
-30
lines changed Original file line number Diff line number Diff line change 1
1
class Apps::<%= class_name %> < Matestack::Ui::App
2
2
3
- # OPTIONAL: Prepare data that gets used on every page of this app
4
- # def prepare
5
- # API calls and db queries go here
6
- # end
3
+ # OPTIONAL: Prepare data that gets used on every page of this app
4
+ # def prepare
5
+ # API calls and db queries go here
6
+ # end
7
7
8
- # MANDATORY: This is where your matestack pages get yielded
9
- def response
10
- components {
11
- page_content
12
- }
13
- end
8
+ # MANDATORY: This is where your matestack pages get yielded
9
+ def response
10
+ components {
11
+ heading text: 'Welcome to your <%= class_name %> app'
12
+ page_content
13
+ }
14
+ end
14
15
15
- # OPTIONAL: Use partials to render stuff like layout components
16
- # def partial_one
17
- # partial {
18
- # # your components go here
19
- # }
20
- # end
16
+ # OPTIONAL: Use partials to render stuff like layout components
17
+ # def partial_example
18
+ # partial {
19
+ # # your components go here
20
+ # }
21
+ # end
21
22
22
- # OPTIONAL: Slots come after partials
23
- # def slots
24
- # end
23
+ # OPTIONAL: Slots come after partials
24
+ # def slot_example
25
+ # slot {
26
+ # # your components go here
27
+ # }
28
+ # end
25
29
26
30
end
Original file line number Diff line number Diff line change 1
1
class Pages::<% unless @namespace.nil? %> <%= @namespace.camelize %> ::<% end %> <% unless @app_name.nil? %> <%= @app_name.camelize %> ::<% end %> <%= class_name %> < Matestack::Ui::Page
2
2
3
- # OPTIONAL: Prepare data for the response method
4
- # def prepare
5
- # API calls and db queries go here
6
- # end
7
-
8
- # MANDATORY: This is where the matestack magic happens
9
- def response
10
- components {
11
- plain 'Hello, mate!'
12
- }
13
- end
3
+ # OPTIONAL: Prepare data for the response method
4
+ # def prepare
5
+ # API calls and db queries go here
6
+ # end
7
+
8
+ # MANDATORY: This is where the matestack magic happens
9
+ def response
10
+ components {
11
+ heading text: 'Welcome to your <%= class_name %> page'
12
+ page_content
13
+ }
14
+ end
15
+
16
+ # OPTIONAL: Use partials to render stuff like layout components
17
+ # def partial_example
18
+ # partial {
19
+ # # your components go here
20
+ # }
21
+ # end
22
+
23
+ # OPTIONAL: Slots come after partials
24
+ # def slot_example
25
+ # slot {
26
+ # # your components go here
27
+ # }
28
+ # end
14
29
15
30
end
You can’t perform that action at this time.
0 commit comments