We're building a piece of forum software for a client. On posts, they want users to be able to upload images (we're using paperclip right now) to insert into the body of the post (similar to wordpress). But they want the system to be able to detect if a number of photos are grouped together, and if so show them in a gallery view (thumbnails as navigation, etc.) vs. showing them one after the other.
Has anyone done anything like this before? Any plugins (rails or JQuery) that would help?
EDIT: Just to clarify - we're not having any problems uploading and resizing images, and we don't have any issues displaying them either inline or as a gallery. What I can't figure out is how to have the system detect whether there is only one image inline or multiple images, and responding accordingly.
For example, if you have a document like this:
lorem ipsum lorem ipsum lorem ipsum
IMAGE
lorem ipsum lorem ipsum lorem ipsum
IMAGE IMAGE IMAGE
lorem ipsum lorem ipsum lorem ipsum
IMAGE
lorem ipsum lorem ipsum
The system needs to know to take the three images in the middle and group them into a gallery automatically, while rending the other two individual images by themselves.