# File uploads in comments

**URL:** <https://www.ruby-forum.com/t/file-uploads-in-comments/123191>\
**Category:** Radiant CMS\
**Created:** [December 14, 2007, 8:22pm UTC](https://www.ruby-forum.com/t/file-uploads-in-comments/123191 "2007-12-14T20:22:05Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![rpheath](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/73ab20/32.png) [@rpheath](https://www.ruby-forum.com/u/rpheath)\
**Post date:** [December 14, 2007, 8:22pm UTC](https://www.ruby-forum.com/t/file-uploads-in-comments/123191/1 "2007-12-14T20:22:05Z")

</div>

Does anyone have an extension that would allow site visitors to upload  
pictures with their comments?

---

<div class="post-metadata">

**Author:** ![rpheath](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/73ab20/32.png) [@rpheath](https://www.ruby-forum.com/u/rpheath)\
**Post date:** [December 14, 2007, 8:32pm UTC](https://www.ruby-forum.com/t/file-uploads-in-comments/123191/2 "2007-12-14T20:32:39Z")

</div>

You might be able to rip some of the ideas from page\_attachments. It  
has good examples of how to handle an associated model with upload.

Sean

---

<div class="post-metadata">

**Author:** ![rpheath](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/73ab20/32.png) [@rpheath](https://www.ruby-forum.com/u/rpheath)\
**Post date:** [December 19, 2007, 5:24pm UTC](https://www.ruby-forum.com/t/file-uploads-in-comments/123191/3 "2007-12-19T17:24:56Z")

</div>

Sean C. wrote:

> You might be able to rip some of the ideas from page\_attachments. It  
> has good examples of how to handle an associated model with upload.
> 
> Sean

In fact, it would be best to have an extension that’s something like  
page\_attachments with comments - I guess that may be an often required  
thing.

Sean, would it be fair to say that all that should be required are 4  
things:

1. An additional migration to extend the page\_attachments table
2. A UI to capture the comment - I think that it is a partial that needs  
modifying
3. Something to save it to the table, probably where page\_attachments  
saves its image path
4. A tag to retrieve the comment

I imagine it could be bolted onto page\_attachments but I don’t know how  
much trouble it will be to keep it updated as page\_attachments  
changes…

Cheers,  
Mohit.  
12/20/2007 | 12:24 AM.

---

<div class="post-metadata">

**Author:** ![rpheath](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/73ab20/32.png) [@rpheath](https://www.ruby-forum.com/u/rpheath)\
**Post date:** [December 20, 2007, 1:47am UTC](https://www.ruby-forum.com/t/file-uploads-in-comments/123191/4 "2007-12-20T01:47:59Z")

</div>

Sean C. wrote:

> This would be best as a separate extension. I just suggested that  
> some of the same ideas could be employed in it.
> 
> Sean

I guess you’re right - it should be a separate extension and  
page\_attachments would make a great starting point!

Cheers,  
Mohit.  
12/20/2007 | 8:46 AM.

---

<div class="post-metadata">

**Author:** ![rpheath](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/73ab20/32.png) [@rpheath](https://www.ruby-forum.com/u/rpheath)\
**Post date:** [December 19, 2007, 10:09pm UTC](https://www.ruby-forum.com/t/file-uploads-in-comments/123191/5 "2007-12-19T22:09:45Z")

</div>

This would be best as a separate extension. I just suggested that some  
of the same ideas could be employed in it.

Sean
