views:

23

answers:

1

As per title. And is there anyway to cache such data? thanks

A: 

This is simple:

class SomeController
  def avatar
    user = User.find(1)
    send_data user.avatar_data, 
      :type => user.avatar_content_type, 
      :disposition => 'inline'
  end
end
Warren Noronha