instance method
source_fragment
Ruby on Rails 8.1.2
Since v4.0.13 PrivateSignature
source_fragment(path, line)
No documentation comment.
Parameters
-
pathreq -
linereq
Source
# File actionpack/lib/action_dispatch/middleware/exception_wrapper.rb, line 336
def source_fragment(path, line)
return unless Rails.respond_to?(:root) && Rails.root
full_path = Rails.root.join(path)
if File.exist?(full_path)
File.open(full_path, "r") do |file|
extract_source_fragment_lines(file.each_line, line)
end
end
end
Defined in actionpack/lib/action_dispatch/middleware/exception_wrapper.rb line 336
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActionDispatch::ExceptionWrapper