views:

1562

answers:

2

I am using the fine paperclip plugin for rails. Everything is nice so far, users can upload images.

Now i want an extra step before my model is saved, asking for confirmation by the uploader that the image looks right.

Is this possible to do with paperclip? If so, how?

+4  A: 

If you really don't want the image hitting your database at all before the user can check it, you could use JavaScript to display the image immediately. Otherwise you'd need to save it somewhere on the backend, whether through Paperclip or otherwise.

If you only want to use Rails and no JavaScript, I'd just save the image, display it back to them, and give them the option to delete it.

fig
+1  A: 

@Dave Sounds like a fine plan.

@tliff Another way to implement Dave's plan:

  • a boolean field on your image model to query against
  • setting the boolean field to true if the user is happy with it
  • a named scope that tests the aforementioned boolean is true
  • use said named scope when displaying the image.

I know paperclip has a post processing step you can hook into, that might come in handy too.

MatthewFord