Rails user experience vs file structure with carrierwave and nested forms - Need input on design decisions
I have 2 models, product and a photos model as follows:
class Product < ActiveRecord::Base has_many :photos, dependent: :destroy accepts_nested_attributes_for :photos, allow_destroy: true end
class Photo < ActiveRecord::Base belongs_to :product validates :album, presence: true mount_uploader :image, PhotoUploader end
I'm using carrierwave & s3 for file uploads.
I can nest the forms so that users can upload photos at the same time that they create the product. In this scenario, the photo models are saved before the product model is saved, which leads to a photo file path of something like:
But the file structure would make more sense if it was something like:
product.id is nil at the time of photo creation.
With that in mind, a few questions:
- Does the file structure really matter that much or am I over thinking it?
- Should I do something instead where the product is saved first with basic info and then the files are attached on a separate form?
- Is there something I'm overlooking like a way to trigger carrierwave to move the files after the product model is saved?
- From a UI standpoint is it bad practice to have users go thru a multi-step process (in this case for creating a product)?