Hi - I would like to iterate through a native folder and execute attachment_fu per each file. Has anyone done this before? Or have any tips or code snippets? Attachment_fu works well via form - but since I have a sizable amount of files I simply want to batch them in - just as if I were doing it via a form. Many thanks! --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
> I would like to iterate through a native folder and execute > attachment_fu per each file. Has anyone done this before? Or have any > tips or code snippets? >I''ve uploaded the relevant code that I use at http://pastie.org/236817. The important parts are UserImage#create_from_file and the FakeUpload class. In my case, I just load the appropriate User, then call: user.image = UserImage.create_from_file(file_path, mime_type) - D -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Awesome - I''ll give this a shot. thanks. On Jul 18, 6:28 pm, Danny Burkes <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > I would like to iterate through a native folder and execute > > attachment_fu per each file. Has anyone done this before? Or have any > > tips or code snippets? > > I''ve uploaded the relevant code that I use athttp://pastie.org/236817. > The important parts are UserImage#create_from_file and the FakeUpload > class. > > In my case, I just load the appropriate User, then call: > > user.image = UserImage.create_from_file(file_path, mime_type) > > - D > -- > Posted viahttp://www.ruby-forum.com/.--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---