class PicturesController < ApplicationController
  before_action :set_picture, only: [:destroy]

  def new
    @picture = Picture.new
  end

  def create
    @picture = Picture.new(picture_params)
    @picture.user_id = session[:user_id]
    if @picture.save
      flash[:success] = "Picture was successfully created."
      redirect_to root_path
      # redirect_to root_path, notice: 'Picture was successfully created.'
    else
      render :new
    end
  end

  def destroy
    @picture.destroy
    flash[:warning] = "Picture was successfully destroyed."
    redirect_to root_path
    # redirect_to root_path, notice: 'Picture was successfully destroyed.'
  end

  private
    def set_picture
      @picture = Picture.find(params[:id])
    end

    def picture_params
      params.require(:picture).permit(:id, :uploaded_file, :user_id)
    end
end

class PicturesController < ApplicationController
  before_action :set_picture, only: [:destroy]

  def new
    @picture = Picture.new
  end

  def create
    @picture = Picture.new(picture_params)
    @picture.user_id = session[:user_id]
    if @picture.save
      flash[:success] = "Picture successfully uploaded."
      redirect_to root_path
      # redirect_to root_path, notice: 'Picture was successfully created.'
    else
      render :new
    end
  end

  def destroy
    @picture.destroy
    flash[:warning] = "Picture successfully destroyed."
    redirect_to root_path
    # redirect_to root_path, notice: 'Picture was successfully destroyed.'
  end

  private
    def set_picture
      @picture = Picture.find(params[:id])
    end

    def picture_params
      params.require(:picture).permit(:id, :uploaded_file, :user_id)
    end
end

Change picture create notice to say upload
Change picture create notice to say upload
