not getting any results in a custom model in a comfy-enabled app. I've got a model that has a Comfortable Mexican Sofa backend, and it includes a file that is to be uploaded to AWS. There's a bucket in place, and I've configured various points:
aws.yml:
development:
access_key_id: 'xxxxxxxxx'
secret_access_key: 'xxxxxxxxx'
development.rb:
config.paperclip_defaults = {
:storage => :s3,
:bucket => 'somerton'
}
model (Drawing.rb):
has_attached_file :image
validates_attachment_content_type :image, content_type: /\Aimage\/.*\Z/
I generated the model using the paperclip generator, and a the schema is
schema.rb:
create_table "drawings", force: :cascade do |t|
t.string "url"
t.string "title"
t.string "description"
t.datetime "created_at"
t.datetime "updated_at"
t.string "image_file_name"
t.string "image_content_type"
t.integer "image_file_size"
t.datetime "image_updated_at"
end
The form partial has been modified to include a file input, and is multipart:
_form.html.haml:
= form.text_field :url
= form.text_field :title
= form.text_field :description
= form.file_field :image
= form.form_group :class => 'form-actions' do
= form.submit :class => 'btn btn-primary'
Anyone see the obvious problem I'm missing? (yes, gem is installed):
gem "paperclip", "~> 4.3" # uploads
gem 'aws-sdk' # allow use of aws for upload storage
When I update a record, I can select a file using the file input, but the columns for the related components are empty:
--- !ruby/object:Drawing
raw_attributes:
id: 1
url: blah blah
title: My new thing
description: Dog's Breakfast
created_at: '2015-10-15 20:02:03.848104'
updated_at: '2015-10-15 20:02:33.344581'
image_file_name:
image_content_type:
image_file_size:
image_updated_at:
...