我正在使用 gruff 创建图像。我已经创建了一个图像,现在我有一个原始图像数据。我不想使用gruff.write('image.png')
,因为我希望应用程序快速。我希望能够在视图上显示原始图像数据。
但问题在于:我不能使用控制器——send_data
我猜是不可能的。有没有办法使用我在 Helper 方法中拥有的原始图像数据,并使用该 helper 方法在视图中显示图像?
module ApplicationHelper
def generated_image()
@graph = create_gruff("50x50", "%m/%d") do |g|
#some code to create a graph
end
end
end