app/controllers/admin/attachments_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 attachment_params
    hack = params.require(:attachment).permit(
      :title,
      :slug,
      :description,
      :file,
      :remove_file,
      :document_id
    )
    if hack[:file].blank?
      hack.except(:file)
    else
      hack
    end
  end
def attachment_params hack = params . require ( :attachment ) . permit ( :title , :slug , :description , :file , :remove_file , :document_id ) if hack [ :file ] . blank? hack . except ( :file ) else hack 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 .