Class ActionController::Routing::ControllerSegment
In: vendor/rails/actionpack/lib/action_controller/routing.rb
Parent: DynamicSegment

Methods

Public Instance methods

Make sure controller names like Admin/Content are correctly normalized to admin/content

[Source]

     # 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.

[Source]

     # File vendor/rails/actionpack/lib/action_controller/routing.rb, line 735
735:       def interpolation_chunk
736:         "\#{#{local_name}.to_s}"
737:       end

[Source]

     # 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

[Source]

     # File vendor/rails/actionpack/lib/action_controller/routing.rb, line 728
728:       def regexp_chunk
729:         possible_names = Routing.possible_controllers.collect { |name| Regexp.escape name }
730:         "(?i-:(#{(regexp || Regexp.union(*possible_names)).source}))"
731:       end

[Validate]