Methods

Class Public methods

new(view)

πŸ“ Source code
# File actionpack/lib/action_dispatch/routing/inspector.rb, line 306
def initialize(view)
  @view = view
  @buffer = []
end
πŸ”Ž See on GitHub

Instance Public methods

πŸ“ Source code
# File actionpack/lib/action_dispatch/routing/inspector.rb, line 323
def footer(routes)
end
πŸ”Ž See on GitHub

header(routes)

The header is part of the HTML page, so we don’t construct it here.

πŸ“ Source code
# File actionpack/lib/action_dispatch/routing/inspector.rb, line 320
def header(routes)
end
πŸ”Ž See on GitHub

no_routes(*)

πŸ“ Source code
# File actionpack/lib/action_dispatch/routing/inspector.rb, line 326
def no_routes(*)
  @buffer << <<~MESSAGE
    <p>You don't have any routes defined!</p>
    <ul>
      <li>Please add some routes in <tt>config/routes.rb</tt>.</li>
      <li>
        For more information about routes, please see the Rails guide
        <a href="https://guides.rubyonrails.org/routing.html">Rails Routing from the Outside In</a>.
      </li>
    </ul>
  MESSAGE
end
πŸ”Ž See on GitHub

result()

πŸ“ Source code
# File actionpack/lib/action_dispatch/routing/inspector.rb, line 339
def result
  @view.raw @view.render(layout: "routes/table") {
    @view.raw @buffer.join("\n")
  }
end
πŸ”Ž See on GitHub

section(routes)

πŸ“ Source code
# File actionpack/lib/action_dispatch/routing/inspector.rb, line 315
def section(routes)
  @buffer << @view.render(partial: "routes/route", collection: routes)
end
πŸ”Ž See on GitHub

section_title(title)

πŸ“ Source code
# File actionpack/lib/action_dispatch/routing/inspector.rb, line 311
def section_title(title)
  @buffer << %(<tr><th colspan="5">#{title}</th></tr>)
end
πŸ”Ž See on GitHub

Definition files