Hi elemibar,
Sorry for the delay in replying
I understand that you want to attach 2 images to the user who is registering. Is this the case?
To attach images we have the model concern Imageable
that we include in the models that we want to attach an image. As you can see this concern has a :has_one
relationship, so it is only prepared to attach a single image.
On the other hand, we have another model concern Documentable
to relate different files to a model. In this case it is allowed to attach more than one file thanks to the :has_many
relationship.
You can see examples of the use of these concerns in the models they contain:
include Documentable
or
include Imageable
I hope this information will be useful for you to move forward.
Best regards.
Hola elemibar,
Disculpa por la demora en la contesación
Entiendo que quieres adjuntar 2 imágenes al usuario que se está registrando. Eso es así?
Para adjuntar imágenes tenemos el concern de modelo Imageable
que lo incluimos en los modelos que queremos adjuntar una imagen. Como verás este concern tiene una relación :has_one
, así que solo está preparado para asociar una sola imagen.
En cambio tenemos otro concern de modelo Documentable
para relacionar diferentes archivos con un modelo. En este caso si que se permite adjuntar más de un archivo gracias a la relación :has_many
.
Puedes ver ejemplos de uso de estos concerns en los modelos que contengan:
include Documentable
o
include Imageable
Espero que esta información te sea útil para seguir avanzando.
Saludos.