module ActionDispatch::Routing::Mapper::Resources
def match(path, *rest, &block)
match 'path', to: 'controller#action', via: :post
[match](rdoc-ref:Base#match).
Matches a URL pattern to one or more routes. For more information, see
def match(path, *rest, &block) if rest.empty? && Hash === path options = path path, to = options.find { |name, _value| name.is_a?(String) } raise ArgumentError, "Route path not specified" if path.nil? case to when Symbol options[:action] = to when String if to.include?("#") options[:to] = to else options[:controller] = to end else options[:to] = to end options.delete(path) paths = [path] else options = rest.pop || {} paths = [path] + rest end if options.key?(:defaults) defaults(options.delete(:defaults)) { map_match(paths, options, &block) } else map_match(paths, options, &block) end end