Paperclip - when validation fails, hold onto attachments

I’ve seen this with paperclip before I think, anyone know how to fix it?

When my validation fails the form is re-rendered with the validation
error messages, all fine. However, the paperclip attachments that were
previously attached get lost.

Thinking that others may have done something with this and grateful if
anyone could share a solution.

Not really acceptable for users to see this behavior.

Thanks

BB.

YES!

  logger.debug "=======\r"
  logger.debug @explonaut.portrait.valid?
  logger.debug @explonaut.portrait.save if

@explonaut.portrait.valid?
logger.debug “=======\r”

=>

@explonaut.portrait.save if @explonaut.portrait.valid?

YEAH … same problem to me!

Do you find a solution?

I do find this >
http://stackoverflow.com/questions/967835/with-rails-paperclip-gem-how-to-temporarily-save-the-uploaded-file-if-the-model
< … but I’m not really happy with that.

Best Regards

I still have the problem - be nice to solve for my users.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs