大佬教程收集整理的这篇文章主要介绍了ruby-on-rails – 如何获取我的Rails应用程序的基本URL(例如http:// localhost:3000)?,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
# models/touchpoint_mailer.rb class TouchpointMailer < ActionMailer::Base def notification_email(touchpoint) recipients "me@myemail.com" from "Touchpoint Customer Portal <portal@touchpointclients.com>" content_type "multipart/alternative" subject "New Touchpoint request" sent_on Time.now body :touchpoint => touchpoint # Add any attachments the user has included touchpoint.assets.each do |asset| attachment :content_type => asset.file_content_type,:body => File.read(asset.url) end end end
这给我以下错误没有这样的文件或目录 – /system/files/7/original/image.png?1254497688与堆栈跟踪说它是对File.read的调用.当我访问show.html.erb页面,并点击图像的链接,这是像http:// localhost:3000 / system / files / 7 / original / image.png?1254497688,图像显示精细.
如何解决这个问题?
以上是大佬教程为你收集整理的ruby-on-rails – 如何获取我的Rails应用程序的基本URL(例如http:// localhost:3000)?全部内容,希望文章能够帮你解决ruby-on-rails – 如何获取我的Rails应用程序的基本URL(例如http:// localhost:3000)?所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。