class ActionDispatch::Routing::HtmlTableFormatter
Public Class Methods
new(view)
click to toggle source
# File lib/action_dispatch/routing/inspector.rb, line 236 def initialize(view) @view = view @buffer = [] end
Public Instance Methods
header(routes)
click to toggle source
The header is part of the HTML page, so we don't construct it here.
# File lib/action_dispatch/routing/inspector.rb, line 250 def header(routes) end
no_routes(*)
click to toggle source
# File lib/action_dispatch/routing/inspector.rb, line 253 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
result()
click to toggle source
# File lib/action_dispatch/routing/inspector.rb, line 266 def result @view.raw @view.render(layout: "routes/table") { @view.raw @buffer.join("\n") } end
section(routes)
click to toggle source
# File lib/action_dispatch/routing/inspector.rb, line 245 def section(routes) @buffer << @view.render(partial: "routes/route", collection: routes) end
section_title(title)
click to toggle source
# File lib/action_dispatch/routing/inspector.rb, line 241 def section_title(title) @buffer << %(<tr><th colspan="4">#{title}</th></tr>) end