Class ActionController::Routing::PathSegment
In: vendor/rails/actionpack/lib/action_controller/routing.rb
Parent: DynamicSegment

Methods

Constants

EscapedSlash = CGI.escape("/")

Public Instance methods

[Source]

     # File vendor/rails/actionpack/lib/action_controller/routing.rb, line 760
760:       def default
761:         ''
762:       end

[Source]

     # 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

[Source]

     # 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

[Source]

     # 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

[Source]

     # File vendor/rails/actionpack/lib/action_controller/routing.rb, line 772
772:       def regexp_chunk
773:         regexp || "(.*)"
774:       end

[Validate]