| Class | ActionController::Routing::ControllerSegment |
| In: |
vendor/rails/actionpack/lib/action_controller/routing.rb
|
| Parent: | DynamicSegment |
Make sure controller names like Admin/Content are correctly normalized to admin/content
# File vendor/rails/actionpack/lib/action_controller/routing.rb, line 741
741: def extract_value
742: "#{local_name} = (hash[:#{key}] #{"|| #{default.inspect}" if default}).downcase"
743: end
Don‘t CGI.escape the controller name, since it may have slashes in it, like admin/foo.
# File vendor/rails/actionpack/lib/action_controller/routing.rb, line 735
735: def interpolation_chunk
736: "\#{#{local_name}.to_s}"
737: end
# File vendor/rails/actionpack/lib/action_controller/routing.rb, line 745
745: def match_extraction(next_capture)
746: if default
747: "params[:#{key}] = match[#{next_capture}] ? match[#{next_capture}].downcase : '#{default}'"
748: else
749: "params[:#{key}] = match[#{next_capture}].downcase if match[#{next_capture}]"
750: end
751: end