cl_video_tag / cl_video_path + Rails
Hi all,
I have a Rails app (4.1.5) that is using Attachinary / Cloudinary to allow select users upload and store images, videos, pdfs, docs, etc. Upload works great, I can see everything up there, stored in logic places with logical paths.
However, I am unable to show the uploaded videos. That is, I can download and show thumbs for images, pdfs, etc. with cl_image_path, but cl_video_path does not work. I get a:
undefined method `cl_video_path' for #<#<Class:0x00007feace36a630>:0x00007feac72abbb0> Did you mean? cl_image_path
I cannot use image_path because it will try to link to /image/upload/publicid. I need /video/upload/publicid. All docs that I have read seem to point to cl_video_path being the answer I'm looking for here. Why is it an undefined method?
Thanks
-
Hi Mary,
Please find the following Attachinary sample project:
https://github.com/taragano/attachinary_all_typesSpecifically, here's how to display a video tag: Note that it'll render the full video tag, not just the URL:
https://github.com/taragano/attachinary_all_types/blob/master/app/views/posts/_preview.html.erb#L7Having said that,
cl_video_pathdoes seem to work well for me, e.g. (ais the model record, andfileis the attachinary-associated attribute):cl_video_path a.file.public_id, format: a.file.formatIf that still doesn't work, please make sure you're using the latest versions of both SDKs (Cloudinary and Attachinary).
As an alternative, you can use the following instead:
cloudinary_url a.file.public_id, format: a.file.format, resource_type: a.file.resource_type0
Post is closed for comments.
Comments
1 comment