Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8060255
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T09:55:35+00:00 2026-06-05T09:55:35+00:00

I am trying to find documentation on how to associate images uploaded through cloudinary

  • 0

I am trying to find documentation on how to associate images uploaded through cloudinary to a particular user that will allow deletion etc by the user that uploads them, but not by other users. However the images should be available to view publicly at all times. I’m relatively new to rails however essentially I am trying to replicate using cloudinary:

class Image

  belongs_to :user

end

class User

  has_many :images

end

Obviously the code is not complete just trying to show the association I’m trying to achieve, if this is a suitable way of representing the relationship. If anyone has suggestions for a better solution or can point me in the direction of some documentation that deals with an issue like this it would be very much appreciated!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T09:55:36+00:00Added an answer on June 5, 2026 at 9:55 am

    Assuming you use CarrierWave with Cloudinary for managing uploads of your Rails model. You need to define an uploader class and mount it to your Image class. Assuming your Image model class has a ‘picture’ attribute:

    class PictureUploader < CarrierWave::Uploader::Base
    
      include Cloudinary::CarrierWave
    
      version :thumbnail do
        process :resize_to_fit => [50, 50]
      end
    
    end
    
    
    class Image
    
      belongs_to :user
    
      mount_uploader :picture, PictureUploader
    
    end
    

    Each user has multiple Image records, each holding a reference to an actual image being uploaded. For embedding such an image:

    <%= image_tag(user.images[0].picture_url) %>
    

    Or a thumbnail:

    <%= image_tag(user.images[0].picture_url(:thumbnail)) %>
    

    See Cloudinary documentation for more details.

    Regarding image deletion: your web application probably allows users to manage images. Simply deleting an Image record would automatically delete the remote image uploaded to Cloudinary. For example:

    user.images.last.destroy
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to find any documentation on Unity configuration but it now seems that
I have been searching Google for that last 15 minutes trying to find Documentation
I'm trying to find some good documentation (book, blog, mailing list etc) on how
I'm having a hell of a time trying to find sybase documentation that says
I am trying to find an online documentation for SQLite2. The project I have
I am fairly new to Git and trying my best to find some documentation
Trying to find an example that has css rollover using sprites & sliding door
Im trying to find every drive letter that isnt C,E,L,S,T,W on a windows 2008
I am trying to find documentation, tutorials, examples on how to generate sounds. I
I'm trying to find documentation on how one would go about creating a custom

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.