method
to_plain_segments
rails latest stable - Class:
ActionController::Routing::RouteSet
Method deprecated or moved
This method is deprecated or moved on the latest stable version. The last existing version (v2.3.8) is shown here.
to_plain_segments(str)public
this must be really fast
# File actionpack/lib/action_controller/routing/recognition_optimisation.rb, line 123
def to_plain_segments(str)
str = str.dup
str.sub!(/^\/+/,'')
str.sub!(/\/+$/,'')
segments = str.split(/\.[^\/]+\/+|\/+|\.[^\/]+\Z/) # cut off ".format" also
segments << nil
segments
end Related methods
- Instance methods
- add_configuration_file
- add_named_route
- add_route
- build_expiry
- builder
- call
- clear!
- configuration_file
- configuration_file=
- deprecated_routes_for_controller_and_action_and_keys
- draw
- empty?
- extra_keys
- extract_request_environment
- generate
- generate_code
- generate_extras
- install_helpers
- load!
- load_routes!
- options_as_params
- raise_named_route_error
- recognize
- recognize_path
- recognize_path
- reload
- reload!
- routes_by_controller
- routes_changed_at
- routes_for
- routes_for_controller_and_action
- routes_for_controller_and_action_and_keys
- segment_tree
- to_plain_segments
- Class methods
- new
- Private methods
-
clear_recognize_optimized! -
remove_recognize_optimized! -
write_recognize_optimized!