方法
類別公開方法
new(view) 連結
原始碼: 顯示 | 在 GitHub 上
# File actionpack/lib/action_dispatch/routing/inspector.rb, line 286 def initialize(view) @view = view @buffer = [] end
執行個體公開方法
header(routes) 連結
標頭屬於 HTML 頁面的一部分,因此不會在這裡建構。
原始碼: 顯示 | 在 GitHub 上
# File actionpack/lib/action_dispatch/routing/inspector.rb, line 300 def header(routes) end
no_routes(*) 連結
原始碼: 顯示 | 在 GitHub 上
# File actionpack/lib/action_dispatch/routing/inspector.rb, line 303 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://rails-guides.dev.org.tw/routing.html">Rails Routing from the Outside In</a>. </li> </ul> MESSAGE end
result() 連結
原始碼: 顯示 | 在 GitHub 上
# File actionpack/lib/action_dispatch/routing/inspector.rb, line 316 def result @view.raw @view.render(layout: "routes/table") { @view.raw @buffer.join("\n") } end
section(routes) 連結
原始碼: 顯示 | 在 GitHub 上
# File actionpack/lib/action_dispatch/routing/inspector.rb, line 295 def section(routes) @buffer << @view.render(partial: "routes/route", collection: routes) end
section_title(title) 連結
原始碼: 顯示 | 在 GitHub 上
# File actionpack/lib/action_dispatch/routing/inspector.rb, line 291 def section_title(title) @buffer << %(<tr><th colspan="5">#{title}</th></tr>) end