aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_controller/routing
diff options
context:
space:
mode:
authorrick <rick@spacemonkey.local>2008-05-10 17:46:55 -0700
committerrick <rick@spacemonkey.local>2008-05-10 17:46:55 -0700
commitd09a8446d5606a5a0b5c024224b09a1318e9cf4d (patch)
tree199ef3554f731c980ea5726e67e34af4ea057c2e /actionpack/lib/action_controller/routing
parentc8451aeeea200043d8a3e6eae9c49def3a154ddb (diff)
parenta7ea06b4ebe252e258f83e7de945b4baa30ec3bc (diff)
downloadrails-d09a8446d5606a5a0b5c024224b09a1318e9cf4d.tar.gz
rails-d09a8446d5606a5a0b5c024224b09a1318e9cf4d.tar.bz2
rails-d09a8446d5606a5a0b5c024224b09a1318e9cf4d.zip
fix merge conflict with actionpack changelog
Diffstat (limited to 'actionpack/lib/action_controller/routing')
-rw-r--r--actionpack/lib/action_controller/routing/segments.rb9
1 files changed, 5 insertions, 4 deletions
diff --git a/actionpack/lib/action_controller/routing/segments.rb b/actionpack/lib/action_controller/routing/segments.rb
index 24ea8c7f2d..b142d18b47 100644
--- a/actionpack/lib/action_controller/routing/segments.rb
+++ b/actionpack/lib/action_controller/routing/segments.rb
@@ -244,11 +244,12 @@ module ActionController
end
class PathSegment < DynamicSegment #:nodoc:
- RESERVED_PCHAR = "#{Segment::RESERVED_PCHAR}/"
- UNSAFE_PCHAR = Regexp.new("[^#{URI::REGEXP::PATTERN::UNRESERVED}#{RESERVED_PCHAR}]", false, 'N').freeze
-
def interpolation_chunk(value_code = "#{local_name}")
- "\#{URI.escape(#{value_code}.to_s, ActionController::Routing::PathSegment::UNSAFE_PCHAR)}"
+ "\#{#{value_code}}"
+ end
+
+ def extract_value
+ "#{local_name} = hash[:#{key}] && hash[:#{key}].collect { |path_component| URI.escape(path_component, ActionController::Routing::Segment::UNSAFE_PCHAR) }.to_param #{"|| #{default.inspect}" if default}"
end
def default