Generating a Showcase
The gem has a generator to generate a full feature example. This is used for testing and development of the gem itself and a demonstration for the user, too.
Run the following command:
rails g svelte_on_rails:showcase
This does:
- Adds Packages/gems:
@hotwired/turbo-rails(for demonstrating with it interacts with Turbo, especially initial-load vs sub-sequent loads)turbo-railsand runs the installeraxiosfor example http interactions@rails/actioncable
- some routes, like
get "svelte_on_rails_showcase/index" - some files within
app/frontend/javascript/svelte_on_rails_showcase/- The
SvelteOnRailsShowcaseControllerwith some views - Some files for setup Streams:
app/channels/application_cable/channel.rbapp/channels/application_cable/connection.rbapp/channels/svelte_on_rails_channel.rb
- The
=> Restart your Server, visit something like http://localhost:5100/svelte_on_rails_showcase and find theese example components on the browser.