Sha256: 523bf6446391be1b7856587708d5856eb15f025c804ed8d94e50bf2b21a894ef

Contents?: true

Size: 362 Bytes

Versions: 4

Compression:

Stored size: 362 Bytes

Contents

# frozen_string_literal: true

module RailsDevtools
  class RouteSearchForm
    include ActiveModel::Model

    def initialize(search: "")
      @search = search.downcase
    end

    def results
      Routes::Collection.all
        .select { |route| route.name.downcase.include?(@search) }
        .group_by { |route| route.engine_info.name }
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
rails_devtools-0.1.3 app/forms/rails_devtools/route_search_form.rb
rails_devtools-0.1.2 app/forms/rails_devtools/route_search_form.rb
rails_devtools-0.1.1 app/forms/rails_devtools/route_search_form.rb
rails_devtools-0.1.0 app/forms/rails_devtools/route_search_form.rb