def save_or_update_saved_search(params)
      if params[:save_new_search].present? || params[:save_search].present?
        if params[:save_new_search].present?
          @saved_search = new_saved_search(params)
        elsif params[:save_search].present? && params[:saved_search].present?
          @saved_search = update_saved_search(params)
        elsif params[:save_search].present?
          @saved_search = new_saved_search(params)
        end

        if @saved_search.save
          flash[:notice] = t('ransack.saved_search.save.success')
        else
          flash[:error] = t('ransack.saved_search.save.error')
        end
      end
    end
def save_or_update_saved_search(params)
      if params[:save_new_search].present? || params[:save_search].present?
        if params[:save_new_search].present?
          @saved_search = new_saved_search(params)
        elsif params[:save_search].present? && params[:saved_search].present?
          @saved_search = update_saved_search(params)
        elsif params[:save_search].present?
          @saved_search = new_saved_search(params)
        end

        if @saved_search.save
          flash[:notice] = t('ransack.saved_search.save.success')
        else
          flash[:error] = t('ransack.saved_search.save.error')
        end
      end
    end
Save or update Saved Search