| Class | ActionController::Routing::PathSegment |
| In: |
vendor/rails/actionpack/lib/action_controller/routing.rb
|
| Parent: | DynamicSegment |
| EscapedSlash | = | CGI.escape("/") |
# File vendor/rails/actionpack/lib/action_controller/routing.rb, line 760
760: def default
761: ''
762: end
# File vendor/rails/actionpack/lib/action_controller/routing.rb, line 764
764: def default=(path)
765: raise RoutingError, "paths cannot have non-empty default values" unless path.blank?
766: end
# File vendor/rails/actionpack/lib/action_controller/routing.rb, line 756
756: def interpolation_chunk
757: "\#{CGI.escape(#{local_name}.to_s).gsub(#{EscapedSlash.inspect}, '/')}"
758: end
# File vendor/rails/actionpack/lib/action_controller/routing.rb, line 768
768: def match_extraction(next_capture)
769: "params[:#{key}] = PathSegment::Result.new_escaped((match[#{next_capture}]#{" || " + default.inspect if default}).split('/'))#{" if match[" + next_capture + "]" if !default}"
770: end