app/controllers/shares_controller.rb
# Never trust parameters from the scary internet, only allow the white list through.
Never trust parameters from the scary internet, only allow the white list through.
Never trust parameters from the scary internet only allow the white list through .
def share_params
      if params[:share]   
        params.require(:share).permit(:file, :original_filename, :public, :tag_list)
      end
    end
def share_params if params [ :share ] params . require ( :share ) . permit ( :file , :original_filename , :public , :tag_list ) end end
Never trust parameters from the scary internet, only allow the white list through.
Never trust parameters from the scary internet only allow the white list through .
# if params[:share] fix the case when user click update button without selecting new file