noobie here hope you guys don't mind! I am trying to request my user / id / pictures.json, but all it returns are the cus attributes that I made the general format. Json {render: json => @ photo.to_json ()}. My question is, how can I create and encapsulate actual data from images, so can my client turn this data into an image? And also, what do I need to create (the attribute is wise), in addition to the image path (let's say you only had useless attributes, for example: height content_type, description, thumbnail file_name)?
this is what i am trying in my index.json.erb so far
} <% @photos.each do |photo|%> data: <%= StringIO.new(Base64.encode64(photo.public_filename(:large))) %> <%end%> }
I'm coming back
{ data: #<StringIO:0x1058a6cd0> }
which is not IMGdata im that searches while searching
source share