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
@@ -54,7 +60,7 @@ class Pages::MyApp::MyExamplePage < Matestack::Ui::Page
54
60
end
55
61
```
56
62
57
-
After creating this example page for our example Matestack app, we're nearly finished. But as you may have guessed, we've yet to prepare the routes and the controller!
63
+
After creating this example page for our example matestack app, we're nearly finished. But as you may have guessed, we've yet to prepare the routes and the controller!
58
64
59
65
### Setting up router and controller
60
66
@@ -63,7 +69,7 @@ This is straightforward and just works *the Rails way*.
63
69
Inside `config/routes.rb`, add a route for the example page:
64
70
65
71
```ruby
66
-
scope :my_appdo
72
+
Rails.application.routes.drawdo
67
73
get 'my_example_page', to:'my_app#my_example_page'
68
74
end
69
75
```
@@ -74,19 +80,18 @@ In `app/controllers/`, create a file called `my_app_controller.rb` and define ou
74
80
classMyAppController < ApplicationController
75
81
76
82
# if it is not already included in the ApplicationController
77
-
# add the Matestack ApplicationHelper here by
78
-
# uncommenting the line below
79
-
# include Matestack::Ui::Core::ApplicationHelper
83
+
includeMatestack::Ui::Core::ApplicationHelper
80
84
81
85
defmy_example_page
82
86
responder_for(Pages::MyApp::MyExamplePage)
83
87
end
88
+
84
89
end
85
90
```
86
91
87
92
### Test it
88
93
89
-
All we got left to do is to start Rails by entering `rails server` in the console and then head to [localhost:3000/my_app/my_example_page](http://localhost:3000/my_app/my_example_page) in our favorite browser!
94
+
All we got left to do is to start Rails by entering `rails server` in the console and then head to [localhost:3000/my_example_page](http://localhost:3000/my_example_page) in our favorite browser!
0 commit comments