【发布时间】:2021-04-12 00:11:40
【问题描述】:
我正在学习 Ruby on Rails,但我一直在使用 Active Storage 和上传文件。我正在使用本教程:
运行项目时,我在终端中看到错误:Unpermitted parameter: :header_image
我双重、三重检查了我的代码,在绝望中我什至通过 chmod -R 777 更改了整个项目目录中的权限,但无法消除此错误。
我正在 A2hosting.com 使用 Ubuntu 20.04 在远程非托管服务器上运行该项目
有什么想法吗?提前谢谢!
【问题讨论】:
-
你必须在强参数中添加 header_image 像这样 def post_params params.require(:post).permit(:title, :body, :header_image) end
标签: ruby-on-rails rails-activestorage