# File lib/action_dispatch/routing/mapper.rb, line 273
273: def delete(*args, &block)
274: map_method(:delete, *args, &block)
275: end
# File lib/action_dispatch/routing/mapper.rb, line 261
261: def get(*args, &block)
262: map_method(:get, *args, &block)
263: end
# File lib/action_dispatch/routing/mapper.rb, line 265
265: def post(*args, &block)
266: map_method(:post, *args, &block)
267: end
# File lib/action_dispatch/routing/mapper.rb, line 269
269: def put(*args, &block)
270: map_method(:put, *args, &block)
271: end
# File lib/action_dispatch/routing/mapper.rb, line 277
277: def redirect(*args, &block)
278: options = args.last.is_a?(Hash) ? args.pop : {}
279:
280: path = args.shift || block
281: path_proc = path.is_a?(Proc) ? path : proc { |params| path % params }
282: status = options[:status] || 301
283:
284: lambda do |env|
285: req = Request.new(env)
286:
287: params = [req.symbolized_path_parameters]
288: params << req if path_proc.arity > 1
289:
290: uri = URI.parse(path_proc.call(*params))
291: uri.scheme ||= req.scheme
292: uri.host ||= req.host
293: uri.port ||= req.port unless req.standard_port?
294:
295: body = %(<html><body>You are being <a href="#{ERB::Util.h(uri.to_s)}">redirected</a>.</body></html>)
296:
297: headers = {
298: 'Location' => uri.to_s,
299: 'Content-Type' => 'text/html',
300: 'Content-Length' => body.length.to_s
301: }
302:
303: [ status, headers, [body] ]
304: end
305: end
Disabled; run with --debug to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.