Showcase
The gem has a generator for a full-feature example. It demonstrates the features, and is used for testing and developing the gem itself.
rails g svelte_on_rails:showcase
What it adds:
- Packages/gems:
@hotwired/turbo-railsandturbo-rails(runsrails turbo:install): shows how components work with Turbo, especially initial vs. subsequent page loadsaxios, for the example HTTP interactions@rails/actioncable
- Routes, like
get "svelte_on_rails_showcase/index" - Files:
app/controllers/svelte_on_rails_showcase_controller.rband views inapp/views/svelte_on_rails_showcase/- Components in
app/frontend/javascript/svelte_on_rails_showcase/ - ActionCable:
app/channels/application_cable/channel.rb,app/channels/application_cable/connection.rb,app/channels/svelte_on_rails_channel.rbandapp/frontend/initializers/actionCable.js
Restart your server and open localhost:3000/svelte_on_rails_showcase.