# frozen_string_literal: true

class RootController < ApplicationController
  layout 'global'

  def index
    # TODO
  end

  def trace
    trace = Trace.find_by id: params[:id]

    if trace
      redirect_to trace_path(trace.platform, trace)
    else
      render 'traces/trace_not_found', status: :not_found
    end
  end
end

# frozen_string_literal: true

class RootController < ApplicationController
  layout 'global'

  def index
    # TODO
  end

  def trace
    trace = Trace.find_by id: params[:id].strip

    if trace
      redirect_to trace_path(trace.platform, trace)
    else
      render 'traces/trace_not_found', status: :not_found
    end
  end
end

Remove whitespace from trace IDs in the search bar
Remove whitespace from trace IDs in the search bar

These values are often pasted from browsers, where whitespace may accidentally creep in.