extract_namespace(record_or_hash_or_array)
private
Remove the first symbols from the array and return the url prefix implied
by those symbols.
# File actionpack/lib/action_controller/polymorphic_routes.rb, line 187
def extract_namespace(record_or_hash_or_array)
return "" unless record_or_hash_or_array.is_a?(Array)
namespace_keys = []
while (key = record_or_hash_or_array.first) && key.is_a?(String) || key.is_a?(Symbol)
namespace_keys << record_or_hash_or_array.shift
end
namespace_keys.map {|k| "#{k}_"}.join
end