ruby-on-rails - 无法上传文件/图像导轨舒适的墨西哥沙发 cms
问题描述
我将舒适的墨西哥沙发 CMS 与我的 rails 6.0 应用程序集成在一起。一切正常。但是文件上传功能不起作用。
服务器不断运行创建和删除ActiveStorage::Blob
和ActiveStorage::Attachment
ActiveStorage::Blob Create (0.8ms) INSERT INTO "active_storage_blobs" ("key", "filename", "content_type", "metadata", "byte_size", "checksum", "created_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["key", "56qutde9f90cknxanwuqnivgv2eo"], ["filename", "g500-black-back.jpg"], ["content_type", "image/jpeg"], ["metadata", "{\"identified\":true}"], ["byte_size", 2223], ["checksum", "EyM+/P6Ccq9Pw69YV7fAww=="], ["created_at", "2019-09-30 11:26:38.992295"]]
ActiveStorage::Attachment Create (2.6ms) INSERT INTO "active_storage_attachments" ("name", "record_type", "record_id", "blob_id", "created_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["name", "attachment"], ["record_type", "Comfy::Cms::File"], ["record_id", 6], ["blob_id", 356], ["created_at", "2019-09-30 11:26:39.029294"]]
(0.4ms) SELECT "comfy_cms_categories"."id" FROM "comfy_cms_categories" WHERE "comfy_cms_categories"."categorized_type" = $1 [["categorized_type", "Comfy::Cms::File"]]
Comfy::Cms::Categorization Load (0.4ms) SELECT "comfy_cms_categorizations".* FROM "comfy_cms_categorizations" WHERE "comfy_cms_categorizations"."categorized_id" = $1 AND "comfy_cms_categorizations"."categorized_type" = $2 AND "comfy_cms_categorizations"."category_id" = $3 [["categorized_id", 6], ["categorized_type", "Comfy::Cms::File"], ["category_id", 1]]
ActiveStorage::Attachment Destroy (0.7ms) DELETE FROM "active_storage_attachments" WHERE "active_storage_attachments"."id" = $1 [["id", 355]]
ActiveStorage::Blob Create (0.7ms) INSERT INTO "active_storage_blobs" ("key", "filename", "content_type", "metadata", "byte_size", "checksum", "created_at") VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING "id" [["key", "so1r6i8qli6p5etiz1fz1jee4hcy"], ["filename", "g500-black-back.jpg"], ["content_type", "image/jpeg"], ["metadata", "{\"identified\":true}"], ["byte_size", 2223], ["checksum", "EyM+/P6Ccq9Pw69YV7fAww=="], ["created_at", "2019-09-30 11:26:39.113055"]]
ActiveStorage::Attachment Create (0.9ms) INSERT INTO "active_storage_attachments" ("name", "record_type", "record_id", "blob_id", "created_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["name", "attachment"], ["record_type", "Comfy::Cms::File"], ["record_id", 6], ["blob_id", 357], ["created_at", "2019-09-30 11:26:39.130977"]]
(0.4ms) SELECT "comfy_cms_categories"."id" FROM "comfy_cms_categories" WHERE "comfy_cms_categories"."categorized_type" = $1 [["categorized_type", "Comfy::Cms::File"]]
Comfy::Cms::Categorization Load (0.4ms) SELECT "comfy_cms_categorizations".* FROM "comfy_cms_categorizations" WHERE "comfy_cms_categorizations"."categorized_id" = $1 AND "comfy_cms_categorizations"."categorized_type" = $2 AND "comfy_cms_categorizations"."category_id" = $3 [["categorized_id", 6], ["categorized_type", "Comfy::Cms::File"], ["category_id", 1]]
ActiveStorage::Attachment Destroy (0.7ms) DELETE FROM "active_storage_attachments" WHERE "active_storage_attachments"."id" = $1 [["id", 356]]
解决方案
推荐阅读
- php - 多维数组中的 MongoDB find() 和 $unset
- git - 尝试设置文件权限时如何修复“致命:无法识别的输入”?
- c# - EF Core 2.1 中带有值生成和 CastingConverter 的 NotSupportedException
- django - django cron 作业无法获取模型查询
- angular - Angular 6延迟加载的组件不渲染
- c - 用函数替换函数指针
- mysql - SQL 查询 - 找出一行从 0 变为另一个值的次数
- bigcommerce - bigCommerce 客户 api - sso 的客户 JWT
- windows - 无法使用“使用 Powershell 运行”选项执行 PowerShell 脚本
- android - Kotlin Android Studio App 在 AsyncTask 类上不断崩溃