0

1つの選択ダイアログで、複数の写真をアップロードしたいと考えています。(今jsonが使える状態ではないので、stringのカラムで実装したいと考えています。)しかし、この場合でのcontrollerのカラムの保存の仕方がわからない状態です。
もしわかる方がいらしたら、どうぞ教えていただきたいです。

db

  add_column :plans, :image, :string
controller
 
  def create
    Plan.create(image: params[:image])
  end

  private

  def plan_params
    params.permit(:image)
  end
view new

  <%= file_field_tag 'image', :multiple => true %>

2

0

この質問に回答するには、ログインする必要があります。

のタグが付いた他の質問を参照する。