1つの選択ダイアログで、複数の写真をアップロードしたいと考えています。(今jsonが使える状態ではないので、stringのカラムで実装したいと考えています。)しかし、この場合でのcontrollerのカラムの保存の仕方がわからない状態です。
もしわかる方がいらしたら、どうぞ教えていただきたいです。
db
1 add_column :plans, :image, :string
controller
1 def create 2 Plan.create(image: params[:image]) 3 end 4 5 private 6 7 def plan_params 8 params.permit(:image) 9 end 10
view
1 <%= file_field_tag 'image', :multiple => true %>
回答1件
あなたの回答
tips
プレビュー