Sha256: 8bf185df4da161604551006fcd087e223ede040daf07f96a8de7a85c510e856c

Contents?: true

Size: 472 Bytes

Versions: 4

Compression:

Stored size: 472 Bytes

Contents

# frozen_string_literal: true

module RailsDevtools
  class RoutesController < BaseController
    def index
      form = RouteSearchForm.new(search: form_params[:search])
      render Routes::Index.new(routes: form.results, form: form)
    end

    def show
      route = Routes::Collection.find(params[:id])
      render Routes::RouteDetails.new(route: route)
    end

    private

    def form_params
      params[:route_search_form] || { search: "" }
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
rails_devtools-0.1.3 app/controllers/rails_devtools/routes_controller.rb
rails_devtools-0.1.2 app/controllers/rails_devtools/routes_controller.rb
rails_devtools-0.1.1 app/controllers/rails_devtools/routes_controller.rb
rails_devtools-0.1.0 app/controllers/rails_devtools/routes_controller.rb