Andrew Madu
2007-Mar-08 13:31 UTC
RubyRails ActiveRecord base64 encode/decode of binary data
Hi, I have binary images stored in a table which I wish to encode/decode with base64 before reading into html object: <object data="data:image/foo;base64, ..base64 data.." />. How can I do this in RubyRails? -- Regards Andrew --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
eden li
2007-Mar-08 14:10 UTC
Re: RubyRails ActiveRecord base64 encode/decode of binary data
controller: require ''base64'' @data = Base64.encode64(Image.find(:first).data) view: <object data="data:image/foo;base64,<%= @data %>> On Mar 8, 9:31 pm, "Andrew Madu" <andrewm...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi, > I have binary images stored in a table which I wish to encode/decode with > base64 before reading into html object: > > <object data="data:image/foo;base64, ..base64 data.." />. > > How can I do this in RubyRails? > > -- > Regards > > Andrew--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---