views:

228

answers:

1

I'm having problem with Rails plugin attachment_fu. On every upload, I get validation error

Size is not included in the list

I'm currently using

  • Rails 2.3.3
  • Ruby 1.8.6

The only thing I found about this problem is quite outdated discussion, which didn't help much.

Is there any solution to this problem?

I'm using attachment_fu, because I wanted to do AJAX file upload by this tutorial, but I couldn't get past the upload problem.

edit: I find only one solution that works, which is something like

def create
  @image = Image.new(params[:image])
  sleep 2 # for windows to catch up
  @image.save ...

but I don't really like doing it this way

+1  A: 

I think what you're really doing there is giving it time for the image processor (Rmagick or ImageScience or whatever you have hooked up) to work.

If you are are creating lots of different sizes at upload, reducing those might help.

Also, in my own experience everything runs much slower in my dev environment than it does in actual production, you may not need the hard coded delay in production.

Mike Buckbee
i've just tested it in production on my Linux box and it works fine, so I'll just keep it this way only in development, heh, anyway thx for the idea
Darth