Error: Validation failed: Images imageable must exist , rails-5.0 , paperclip-5
While i was trying to submit the form, following error occured: Validation failed: Images imageable must exist and render the same new.html.erb view. If i comment the file field in new.html.erb . Product is being created successfully. ProductsController: def new @product = Product.new end def create @product = Product.create!(product_params) if @product.save redirect_to products_path, notice: "Product Created Successfully" else render "new" end end def product_params params.require(:product).permit(:name, :quantity, :price, images_attributes: [:id, :photo, :_destroy]) end new.html.erb: <%=