class SupportsController < ApplicationController
  ##--- Breadcrum_rails
  add_breadcrumb I18n.t("breadcrumbs." + controller_name), :supports_path
  add_breadcrumb "Soporte Técnico", :contact_support_path, only: :contact_support

  def contact_support
    if params[:support].present?
      returns = false
      params[:support].map { |_x, y| returns = true if y.blank? }
      respond_to do |format|
        if returns
          format.js { render "contact_support", locals: { notice: "Debe llenar todos los campos del formulario." } }
        else
          SupportMailer.contact_support(params[:support], current_user).deliver_now
          format.js
        end
      end
    end
  end

  def system_updates # change the following
    @date = "2018/09/05" # yyyy/mm/dd
  end
end
