instance method
draw
Ruby on Rails 6.1.7.10
Since v6.1.7.10Signature
draw(name)
No documentation comment.
Parameters
-
namereq
Source
# File actionpack/lib/action_dispatch/routing/mapper.rb, line 1611
def draw(name)
path = @draw_paths.find do |_path|
File.exist? "#{_path}/#{name}.rb"
end
unless path
msg = "Your router tried to #draw the external file #{name}.rb,\n" \
"but the file was not found in:\n\n"
msg += @draw_paths.map { |_path| " * #{_path}" }.join("\n")
raise ArgumentError, msg
end
route_path = "#{path}/#{name}.rb"
instance_eval(File.read(route_path), route_path.to_s)
end
Defined in actionpack/lib/action_dispatch/routing/mapper.rb line 1611
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActionDispatch::Routing::Mapper::Resources