asset.rb in config/initializers - Rails App 3.2.13, Ruby 2.0.0-p0 -
in 1 of rails app working, find file called
asset.rb
inside config/initializers
directory , contains following details:
actioncontroller::base.asset_host = proc.new { |source, request| if request.env["request_path"].include? ".pdf" "file://#{rails.root.join('public')}" else "#{request.protocol}#{request.host_with_port}" end }
can tell me means. have pdf report generation functionality in our app. anyway, have searched lot , couldn't find better answer.
please help. :)-
it looks pdf files (probably generated pdf report generation) stored in /public
directory. code doing first checking if path of request contains string ".pdf".
if request_path
contains .pdf
sets base.asset_host
file://path_to_app/public
otherwise e.g. https://host:port
.
so think being done somewhere is, if there request pdf
file serve file on file://
protocol regardless of request protocol, , other files use request protocol.
you search within application base.asset_host
see , how being used.
Comments
Post a Comment