Method: ActionDispatch::Request#route_uri_pattern
- Defined in:
- lib/action_dispatch/http/request.rb
#route_uri_pattern ⇒ Object
Returns the URI pattern of the matched route for the request, using the same format as ‘bin/rails routes`:
request.route_uri_pattern # => "/:controller(/:action(/:id))(.:format)"
159 160 161 162 163 164 165 166 167 |
# File 'lib/action_dispatch/http/request.rb', line 159 def route_uri_pattern unless pattern = get_header("action_dispatch.route_uri_pattern") route = get_header("action_dispatch.route") return if route.nil? pattern = route.path.spec.to_s set_header("action_dispatch.route_uri_pattern", pattern) end pattern end |