Class: ActionDispatch::Routing::ConsoleFormatter::Base
- Defined in:
- actionpack/lib/action_dispatch/routing/inspector.rb
Instance Method Summary collapse
- #footer(routes) ⇒ Object
- #header(routes) ⇒ Object
-
#initialize ⇒ Base
constructor
A new instance of Base.
- #no_routes(engine, routes, filter) ⇒ Object
- #result ⇒ Object
- #section(routes) ⇒ Object
- #section_title(title) ⇒ Object
Constructor Details
#initialize ⇒ Base
Returns a new instance of Base.
188 189 190 |
# File 'actionpack/lib/action_dispatch/routing/inspector.rb', line 188 def initialize @buffer = [] end |
Instance Method Details
#footer(routes) ⇒ Object
205 206 |
# File 'actionpack/lib/action_dispatch/routing/inspector.rb', line 205 def (routes) end |
#header(routes) ⇒ Object
202 203 |
# File 'actionpack/lib/action_dispatch/routing/inspector.rb', line 202 def header(routes) end |
#no_routes(engine, routes, filter) ⇒ Object
208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 |
# File 'actionpack/lib/action_dispatch/routing/inspector.rb', line 208 def no_routes(engine, routes, filter) @buffer << if filter.key?(:controller) "No routes were found for this controller." elsif filter.key?(:grep) "No routes were found for this grep pattern." elsif routes.none? if engine "No routes defined." else <<~MESSAGE You don't have any routes defined! Please add some routes in config/routes.rb. MESSAGE end end unless engine @buffer << "For more information about routes, see the Rails guide: https://guides.rubyonrails.org/routing.html." end end |
#result ⇒ Object
192 193 194 |
# File 'actionpack/lib/action_dispatch/routing/inspector.rb', line 192 def result @buffer.join("\n") end |
#section(routes) ⇒ Object
199 200 |
# File 'actionpack/lib/action_dispatch/routing/inspector.rb', line 199 def section(routes) end |
#section_title(title) ⇒ Object
196 197 |
# File 'actionpack/lib/action_dispatch/routing/inspector.rb', line 196 def section_title(title) end |