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-rails and runs the installer
    • axios for 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 SvelteOnRailsShowcaseController with some views
    • Some files for setup Streams:
      • app/channels/application_cable/channel.rb
      • app/channels/application_cable/connection.rb
      • app/channels/svelte_on_rails_channel.rb

=> Restart your Server, visit something like http://localhost:5100/svelte_on_rails_showcase and find theese example components on the browser.


Copyright © 2025-2027 sedlmair.ch. Distributed by MIT license.