If I already have a photo in my file system, how can I save it without submitting a form? I would like to do this in the controller when some action happens.
I use paperclip to save my photos. therefore, if you have an idea how to make paperclip save it, it will also be very useful.
Clip:
I already have a photo saved with a paper clip. This photo belongs to the horse (model). What I want to do is when a new horse is created, gives that horse the same photo. so how can i do that. I tried to point to this photo with a paper clip. I just copied the attributes of the original photo. he does not work. paperclip looks in the wrong folder.
So, I have a model. he belongs to a horse model. Four attributes are required using paperclip: data_content_type, data_file_name, data_file_size, data_updated_at.
If I then create a new instance of the class photo with Photo.new and give it four clip parameters, paperclip looks for another place where the file is saved.
What can I do? How can I save it in the controller without submitting the form? (with a folder (preferably) or without)
thanks for any answers
source
share