Flowdock
method

match

Importance_0
v3.2.13 - Show latest stable - 0 notes - Class: ActionDispatch::Routing::Mapper::Resources
match(path, *rest) public

No documentation

This method has no description. You can help the Ruby on Rails community by adding new notes.

Hide source
# File actionpack/lib/action_dispatch/routing/mapper.rb, line 1246
        def match(path, *rest)
          if rest.empty? && Hash === path
            options  = path
            path, to = options.find { |name, value| name.is_a?(String) }
            options[:to] = to
            options.delete(path)
            paths = [path]
          else
            options = rest.pop || {}
            paths = [path] + rest
          end

          path_without_format = path.to_s.sub(/\(\.:format\)$/, '')
          if using_match_shorthand?(path_without_format, options)
            options[:to] ||= path_without_format.gsub(%{^/}, "").sub(%{/([^/]*)$}, '#\1')
          end

          options[:anchor] = true unless options.key?(:anchor)

          if options[:on] && !VALID_ON_OPTIONS.include?(options[:on])
            raise ArgumentError, "Unknown scope #{on.inspect} given to :on"
          end

          paths.each { |_path| decomposed_match(_path, options.dup) }
          self
        end
Register or log in to add new notes.