0

My app has a listings table(:name, :description) and a pictures table(:image_id, :listing_id). I am using a nested form(tabbed) for getting all this info and its working fine with gem carrierwave. For the last couple of days I am trying to add amazon s3 direct image uploading feature to my rails application. But it seems like its hard to accomplish this in a nested form. So i am planning to list all image_url in the listing table itself. As its all just url's of the real image is it a good idea to do it this way? (i will only allow maximum 8 images per listing)??

I am planning to do this with refile if possible. Looking for someone to shed some light into this topic...Thanks in advance for trying to help :)

  • what problem are you facing?Have you configured aws-s3 using keys.what error do you get? – Milind Jun 26 '15 at 13:24
  • i quite dont remember it now. I think i keep on getting the error the "image_id" is missing. Anyway now i restored it back to my previous commit for a fresh start on this. Is it a good idea to keep all in one table???(I am having a feeling that its not a good idea in a design perspective ) –  Jun 26 '15 at 13:49

1 Answers1

0

Your direct upload has no relation with nested form. Each image is handled by the gem carrierwave itself. If you are still up for direct upload you may try the following the gems:

https://github.com/waynehoover/s3_direct_upload

https://github.com/dwilkie/carrierwave_direct

About listing image url, I am not clear about your question. If possible, put some real examples. Show how your models are designed. So at least people can help with concrete idea how to handle only specific number of record (image_url as per your discussion).

Rubyrider
  • 3,567
  • 1
  • 28
  • 34
  • The pictures table only contains one image_id and the listing_id(1-many relationship). I changed everything for a different approach, but now again trying with the methods you mentioned. I will post a different question with all the details. Thank you for trying to help –  Jun 26 '15 at 14:27