SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member
    Join Date
    Dec 2006
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Images for avatar and capistrano

    Hello all,
    I have an issue, I use capistrano to deploy my rails app. I now want to add in personal avatar's to my forum. I am using a hacked up version of Beast and I can't stand "Gravatar.com". So here is my issue. I am not sure if storing all those images in the db is going to be a problem down the road as now it is just an avatar but later or even sooner it will be pictures within the posts and other uploaded pictures. I can't see using the file system because every new capistrano deployment creates an entirely new tree for the app and all my images would be stored in the previous version so I don't see that working. Has anyone else delt with this successfully?

    Also, I see how I can use the send_data method to view the image that is in my database on the page but that overwrites the entire page so how do you view a n image in a page that is from the db?


    Brian

  2. #2
    SitePoint Member
    Join Date
    Aug 2005
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by zooxmusic
    Also, I see how I can use the send_data method to view the image that is in my database on the page but that overwrites the entire page so how do you view a n image in a page that is from the db?
    You could make a separate action for serving images like for example "/assets/avatar" and have the image tag like this "<img src="/assets/avatar" />", appending necessary parameters of course.

  3. #3
    Mal Reynolds Mandibal's Avatar
    Join Date
    Aug 2003
    Location
    Columbus
    Posts
    718
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    For the uploaded image storage and capistrano you can just store the images in the shared directory. The shared directory does not get overwritten and therefore is a good place to put the uploaded files directory. You can add this to your include path in the environment files using the environment specific file to put a machine specific path to the directory.
    Erh


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •