Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Rails 7.2] Active Storage has many attached error during upload #181

Closed
w-zygmuntowicz opened this issue Oct 13, 2024 · 1 comment
Closed

Comments

@w-zygmuntowicz
Copy link
Contributor

System configuration

ruby 3.3.5 (2024-09-03 revision ef084cc8f4) [x86_64-linux]
Rails 7.2.1
motor-admin 0.4.31

Description

When trying to upload files for a model with has_many_attached option set the 500 error appears inside the browser inspector and the files are not saved. It is possible to save files when using has_one_attached option.

Error

POST http://localhost:3000/motor_admin/api/data/active_storage__attachments
500 Internal Server Error

Response

The update action could not be found for the :wrap_io_params
callback on Motor::ActiveStorageAttachmentsController, but it is listed in the controller's
:only option.

Raising for missing callback actions is a new default in Rails 7.1, if you'd
like to turn this off you can delete the option from the environment configurations
or set config.action_controller.raise_on_missing_callback_actions to false.

{
    "errors": [
        "The update action could not be found for the :wrap_io_params\ncallback on Motor::ActiveStorageAttachmentsController, but it is listed in the controller's\n:only option.\n\nRaising for missing callback actions is a new default in Rails 7.1, if you'd\nlike to turn this off you can delete the option from the environment configurations\nor set `config.action_controller.raise_on_missing_callback_actions` to `false`.\n"
    ]
}

Steps to reproduce

  1. rails new testing_motor
  2. cd testing_motor
  3. bin/setup
  4. Append "gem 'motor-admin'" to the Gemfile
  5. bundle install
  6. rails motor:install && rails db:migrate
  7. bin/rails active_storage:install && rails db:migrate
  8. rails g model Post title:string body:text
  9. inside the app/models/post.rb insert a line has_many_attached :images
  10. rails db:migrate
  11. rails s
  12. Visit http://localhost:3000/motor_admin/data/posts
  13. Create a new post
  14. Click on the post
  15. Click on the images attachments
  16. Try to upload files
  17. The error appear inside a network tab, but files are not persisted
@w-zygmuntowicz
Copy link
Contributor Author

Turned out it's a duplicate of #169

@w-zygmuntowicz w-zygmuntowicz closed this as not planned Won't fix, can't repro, duplicate, stale Oct 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant