I'm using s3 to host my images and active scaffold gem to deal with the admin part of my app. I'm currently facing the following problem:
Considering the following show action:
def show
@record = find_if_allowed(params[:id], :read)
do_show
send_data(@record.document_file_content)
end
I can't display my image correctly, clicking the show of a s3 image results in weird encrypted characters such as:
�PNG IHDRVO �iCCPICC ProfileH��WXS��[R -)�w�W�#l�$@(��]YTp�"���
��ņ]Y{XPYY6Tޤ���}��ͽ?g�9�s�@ц����*��/��2��S��G�*�(���|���pe��wyw�B�j%�����U�9\!$�4����!puv��B��*��!�U�
D\�3�X]�Ӥ�Rb��7d*�%�@A̛Y�q�m���=ٙ,�� ���̓X�...
Since the bucket is configured correctly, I assume it must be a way to display this content as an image tag. I tried overwritting the show view for this controller but was unsuccessful.
Have you run into this problem before? If yes, what would be the best option for me?
Kind regards
I had to make an Helper such as: