If i allready have a photo in my filesystem how can i save it without submitting a form? I would like to do that in a controller when some action occurs.
I am using paperclip to save my photos. so if you have any idea how to make paperclip save it it would also be very helpful.
Paperclip:
I allready have a photo saved with paperclip. This photo belongs to a horse(model). What i want to do is when a new horse is created give that horse the same photo. so how can i do that. i tried to point to that picture with paperclip. I just copied the attributes the original photo has. it doesnt work. paperclip looks in the wrong folder.
So I have photo model. it belongs to a horse model. With paperclip the 4 attributes are needed: data_content_type, data_file_name, data_file_size, data_updated_at.
If i then create a new instance of class photo with Photo.new and give it the four paperclip parameters paperclip looks for different location that the file is saved in.
What can i do? How can i save it in controller without submitting a form? (with papeclip(preferable) or without)
thank you for any answers