Prohlížeč zdrojového kódu
config/routes.rb
Rails.application.routes.draw do
get "up" => "rails/health#show", as: :rails_health_check
root "pages#home"
resources :examples, only: [:index, :show], param: :slug do
member do
post :run_scenario
end
end
get "source", to: "source#show", as: :source_index
# trailing_slash: true makes path helpers emit URLs ending with "/" (e.g. /source/app/foo.js/).
# This is required so Turbo Drive doesn't treat the URL as an unvisitable extension —
# Turbo checks the last path component's extension and refuses to handle .js, .css, etc.
# A trailing slash makes the last component empty, bypassing that check.
#
# format: false prevents Rails from extracting a format from the wildcard path segment
# (without it, /source/foo.js would set params[:format] = "js").
# The HTML format is enforced separately in SourceController.
scope trailing_slash: true do
get "source/*path", to: "source#show", as: :source_show, format: false
end
end