Skip to content

Commit

Permalink
Ensure we have an array to collect
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremy committed Jun 7, 2008
1 parent 6775cac commit 78a0cca
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion actionpack/lib/action_controller/routing/segments.rb
Expand Up @@ -249,7 +249,7 @@ def interpolation_chunk(value_code = "#{local_name}")
end

def extract_value
"#{local_name} = hash[:#{key}] && hash[:#{key}].collect { |path_component| URI.escape(path_component.to_param, ActionController::Routing::Segment::UNSAFE_PCHAR) }.to_param #{"|| #{default.inspect}" if default}"
"#{local_name} = hash[:#{key}] && Array(hash[:#{key}]).collect { |path_component| URI.escape(path_component.to_param, ActionController::Routing::Segment::UNSAFE_PCHAR) }.to_param #{"|| #{default.inspect}" if default}"
end

def default
Expand Down

0 comments on commit 78a0cca

Please sign in to comment.