I have a little problem with paperclip saving the data passed through the form…
If I’m trying to save the record with .save() it won’t save.. When I look in the server/log there are no errors or warnings for the paperclip gem :-/
# trying to save the record with save() -- not working :-/
def create
@baan_import = BaanImport.new(params[:baan_import])
if @baan_import.save
redirect_to(baan_imports_url)
else
render 'new'
end
end
Server-log: (using .save() in controller)
https://gist.github.com/1327347
I just don’t get it why it’s working if I’m using .create instead of .save()
# trying to save the record with Model.create() -- working!
def create
@baan_import = BaanImport.create(params[:baan_import])
redirect_to(baan_imports_url)
end
Server-log: (using .create() in controller)
https://gist.github.com/1327359
Can some one explain me why it’s working with create and not with save??
Thanks,
Michael
Can you show us the
BaanImportmodel. My first guess is you’re possibly missingbaan_uploadinattr_accessibleon your model, and as a result, Rails will not let you mass assign the file parameter for upload.Can you also confirm (would appear as though it’s properly set up) that your form has
html => {:multipart => true}as an option?