Displaying fleximage image from DB

My REST app has fleximage working (at least I think so) by storing the
images in the database. Through cocoamysl, I can see the images in the
database but I have no idea how to display them in my ‘show’ view. In
the fleximage tutorial it says to use this code in the views:

<%= image_tag url_for(:controller => ‘products’,
:action => ‘show’,
:id => 5) %>

When I do that and check the source code, this is what is displayed:

5

Anyone know how to get images to display from the DB in a REST app using
FlexImage?

Justin Ko wrote:

My REST app has fleximage working (at least I think so) by storing the
images in the database. Through cocoamysl, I can see the images in the
database but I have no idea how to display them in my ‘show’ view. In
the fleximage tutorial it says to use this code in the views:

<%= image_tag url_for(:controller => ‘products’,
:action => ‘show’,
:id => 5) %>

When I do that and check the source code, this is what is displayed:

5

Anyone know how to get images to display from the DB in a REST app using
FlexImage?

You need to create an action that renders the image. In your
controller:

class MyController < ApplicationController
def image
@image = MyImage.find(1)
render_flex_image(@image)
end
end

Then try:

Turns out the image_tag helper will append an extension of .png to your
url if it has no extension. So unless you have a custom route with a
file extension in it, image_tag will be problematic.

I should fix that in the docs.

It works! Thank You Very Much!