hyperoslo / hyperoslo/activeadmin_polymorphic
Image Upload
- Ngôn ngữ chính
- Ruby
- Star
- 20
- Fork
- 8
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Mô tả
Hi,
I have an application with the models Section and Element with polymorphic associations to Paragraph and Image.
```
class Section < ActiveRecord::Base
has_many :elements
end
```
```
class Element < ActiveRecord::Base
belongs_to :section
belongs_to :implementation, polymorphic: true
accepts_nested_attributes_for :implementation
end
```
```
class Paragraph < ActiveRecord::Base
has_one :element, as: :implementation
end
```
```
class Image < ActiveRecord::Base
mount_uploader :file, ImageUploader
has_one :element, as: :implementation
end
```
I was able to make the Section form with the Paragraph class. However, with Image class I not able to upload files due to file fields in form are stripped out as you mentioned in the to documentation.
I have already configured carrierwave + remotipart and actually images are uploaded asynchronously from the new image form (outsite the Section form). However, but I was not able to make that work within the Section form. I have noticed that file are still stripped out only when I try to add and send a new Image from the Section form.
Do you have an example or more detailed documentation regarding image uploading?
Thanks in advance
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Hướng nghiên cứu
The issue names Section, Element, Paragraph, Image, CarrierWave, Remotipart, and the Section form; start by reproducing nested Image creation there and compare it with the standalone new Image form. Done means an example or documentation explains the required setup and image upload works from the Section form.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- rails, ruby
- Lĩnh vực
- backend, documentation
- Loại issue
- Lỗi
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Cần làm rõ
- Mức phù hợp với người mới
- 25/100