routes.rb
file (a url that you send to your app, www.mysite.com/gimme-this-image
)
get '/email-images/:id', to: 'controller_name#masked_url', as: :masked_url
#masked_url
you will return the actual file by using send_data:# if using carrierwave
image = EImage.find_by_id(params[:id])
if image
send_data open(image.email_image.url).read, filename: image.email_image.url, disposition: "inline" # attachment
else
raise ActionController::RoutingError.new("No Page Found")
end