Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jgaskins/server_rendered_clearwater_example
Server-rendered Clearwater example
https://github.com/jgaskins/server_rendered_clearwater_example
Last synced: 22 days ago
JSON representation
Server-rendered Clearwater example
- Host: GitHub
- URL: https://github.com/jgaskins/server_rendered_clearwater_example
- Owner: jgaskins
- Created: 2017-07-05T02:55:36.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-07-05T03:12:06.000Z (over 7 years ago)
- Last Synced: 2024-12-09T10:55:45.309Z (25 days ago)
- Language: Ruby
- Size: 18.6 KB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Server-rendered Clearwater example
To server-render a Clearwater app with Rails:
- [Add `app/shared` to your Ruby load path](https://github.com/jgaskins/server_rendered_clearwater_example/blob/master/config/application.rb#L15)
- [Add `app/shared` to the Sprockets load path](https://github.com/jgaskins/server_rendered_clearwater_example/blob/master/config/initializers/assets.rb#L10)
- [Write your shared components in `app/shared`](https://github.com/jgaskins/server_rendered_clearwater_example/blob/master/app/shared/components/layout.rb)
- Rename `app/assets/javascripts/application.js` to [`app/assets/javascripts/application.rb`](https://github.com/jgaskins/server_rendered_clearwater_example/blob/master/app/assets/javascripts/application.rb)
- [Add a Rails controller that instantiates your app on the server similar to the client app](https://github.com/jgaskins/server_rendered_clearwater_example/blob/master/app/controllers/home_controller.rb)
- [Make sure to pass a router with its location set to the request](https://github.com/jgaskins/server_rendered_clearwater_example/blob/master/app/controllers/home_controller.rb#L7)
- [Add that route as the root and catch-all routes](https://github.com/jgaskins/server_rendered_clearwater_example/blob/master/config/routes.rb#L2-L3)
- [Add a view for that controller that renders the app inside the element your client app will render into](https://github.com/jgaskins/server_rendered_clearwater_example/blob/master/app/views/home/index.html.erb)