Methods
Class Public methods
new(view)
📝 Source code
# File actionpack/lib/action_dispatch/routing/inspector.rb, line 188
def initialize(view)
@view = view
@buffer = []
end
🔎 See on GitHub
Instance Public methods
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 202
def header(routes)
end
🔎 See on GitHub
no_routes(*)
📝 Source code
# File actionpack/lib/action_dispatch/routing/inspector.rb, line 205
def no_routes(*)
@buffer << <<-MESSAGE.strip_heredoc
<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="http://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 218
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 197
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 193
def section_title(title)
@buffer << %(<tr><th colspan="4">#{title}</th></tr>)
end
🔎 See on GitHub