Class: RailsDevtools::Routes::RouteDetails

Inherits:
Components::ApplicationComponent show all
Includes:
Phlex::Rails::Helpers::FormWith
Defined in:
app/views/rails_devtools/routes/route_details.rb

Defined Under Namespace

Classes: ControllerCard, RoutePathInput

Instance Method Summary collapse

Methods inherited from Components::ApplicationComponent

#before_template

Constructor Details

#initialize(route:) ⇒ RouteDetails

Returns a new instance of RouteDetails.



7
8
9
# File 'app/views/rails_devtools/routes/route_details.rb', line 7

def initialize(route:)
  @route = route
end

Instance Method Details

#view_templateObject



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'app/views/rails_devtools/routes/route_details.rb', line 11

def view_template
  turbo_frame_tag("drawer_content") do
    div(class: "mt-4 w-full sm:min-w-80") do
      engine_name
      div(class: "flex justify-between gap-x-2 items-center") do
        h3(class: "text-lg font-bold mb-2") { route_name }
        div(class: "badge badge-lg bg-base-300 text-sm") { @route.verb }
      end
      p(class: "text-sm text-neutral") { only_path }
      open_link
      segments
      div(class: "mt-4 pt-4 border-t-2 border-base-300 mt-2 text-sm text-neutral") do
        more_info_card
      end
      route_path_input
    end
  end
end