我现在在ruby中已经把图片保存到数据库中,但是读不出来,
我是这样写的
def picture
@rypicture = RyPicture.find(params[:id])
send_data(@rypicture.data,
:filename => @rypicture.name,
:type => @rypicture.content_type,
:disposition => 'inline')
end
在show界面上该如何写呢?
我是这样写的
def picture
@rypicture = RyPicture.find(params[:id])
send_data(@rypicture.data,
:filename => @rypicture.name,
:type => @rypicture.content_type,
:disposition => 'inline')
end
在show界面上该如何写呢?
作者在Ruby应用中将图片保存到了数据库,但遇到了无法从数据库读取出图片的问题。该文探讨了具体的实现代码并寻求解决方法。

2407

被折叠的 条评论
为什么被折叠?



