While going through the (quite good) ShareBox Tutorial that teaches you to build a Dropbox-like sharing app, I stumbled on a nasty bug. The tutorial wisely uses the paperclip gem for file attachments, but after moving from local hosting to Amazon’s S3, I started getting an exception in the AssetsController
ActiveRecord::UnknownAttributeError in AssetsController#create unknown attribute: uploaded_file app/controllers/assets_controller:17:in `create'
At the time, Googling the error didn’t help (gasp!), so here are all the pieces together to help any wary travelers who may stumble here looking for the same answer. Turns out, the error doesn’t indicate the real problem at all. Fortunately, however, the fix is simple.
- In the asset model file, asset.rb, change the path to
- In the Gemfile, replace
'awk-sdk'. Don’t forget to
Credits go to