Ruby on rails 我的照片字段don';当我编辑我的文章时,我不能保存选择

Ruby on rails 我的照片字段don';当我编辑我的文章时,我不能保存选择,ruby-on-rails,ruby,postgresql,Ruby On Rails,Ruby,Postgresql,当我在后台编辑帖子时,问题就出现了。所有的“属于”表都不保存信息是在我创建帖子时保存的 我在网上找不到解决办法。我不是一个实验开发人员,所以我现在不知道该去哪里找 我的上传文件: require "image_processing/mini_magick" class ImageUploader < Shrine plugin :processing # allows hooking into promoting plugin :versions # enable Shrine

当我在后台编辑帖子时,问题就出现了。所有的“属于”表都不保存信息是在我创建帖子时保存的

我在网上找不到解决办法。我不是一个实验开发人员,所以我现在不知道该去哪里找

我的上传文件:

require "image_processing/mini_magick"

class ImageUploader < Shrine
 plugin :processing # allows hooking into promoting
 plugin :versions   # enable Shrine to handle a hash of files
 plugin :delete_raw # delete processed files after uploading

 process(:store) do |io, context|
   original = io.download
   pipeline = ImageProcessing::MiniMagick.source(original)

   size_200 = pipeline.resize_to_limit!(200, 200)
   size_300 = pipeline.resize_to_limit!(300, 300)

   original.close!

   { original: io, moyen: size_300, small: size_200 }
 end
end
我的控制器:

# frozen_string_literal: true

class Admin::ActualitiesController < Admin::AdminController
  before_action :set_actuality, only: %i[show edit update destroy]

  def index
    @actualities = Actuality.order('id DESC').page(params[:page]).per(10)
  end

  def new
    @actuality = Actuality.new
    @actuality.build_photo
  end

  def edit
  end

  def show; end

  def create
    @actuality = Actuality.new(actuality_params)

    if @actuality.save
      redirect_to :show, notice: ''
    else
      render :new, notice: ''
    end
  end

  def update
    if @actuality.update(actuality_params)
      redirect_to :show, notice: ''
    else
      render :edit
    end
  end

  def destroy
    @actuality.destroy
    redirect_to admin_actualities_path, notice: ''
  end

  private

  def set_actuality
    @actuality = Actuality.find_by(id: params[:id])
  end

  def actuality_params
    params.require(:actuality).permit(:title, :body, :apercu, :meeting, photo_attributes: [:photo])
  end
end
#冻结的字符串文字:true
类Admin::实现控制器
以我的形式:

<%= f.simple_fields_for :photo do |ff| %>
    <%= ff.input :photo, as: :hidden %>
    <%= ff.input :photo, as: :file %>
<% end %>

如果你有任何解决办法,我就在这里!
谢谢

张贴整个控制器。
更新
操作中使用的
现状参数是否正确?我用整个控制器编辑帖子。谢谢!我找不到解决办法是的你的整个控制器?根本没有
创建
更新
方法?对不起,我弄错了。它不是管理员控制器。我在晨报上编辑了整个控制器。
更新
操作中使用的
现状参数是否正确?我用整个控制器编辑帖子。谢谢!我找不到解决办法是的你的整个控制器?根本没有
创建
更新
方法?对不起,我弄错了。它不是管理员控制器。我早上编辑它
<%= f.simple_fields_for :photo do |ff| %>
    <%= ff.input :photo, as: :hidden %>
    <%= ff.input :photo, as: :file %>
<% end %>