Sha256: 3863b1bd2a8089427255f3c0ac38bf48de5ecfbff32ab362dbc44246178b2d3a
Contents?: true
Size: 687 Bytes
Versions: 13
Compression:
Stored size: 687 Bytes
Contents
# frozen_string_literal: true module MaintenanceStandards # Informs the user and redirects when needed # # @param result [Boolean] was update or create succesful # @param path [URL] where to redirect to # @param notice [String] What to show on success # @param error [String] What to show on error # @param render_action [Symbol] What to render # def flash_and_redirect(result, path, notice, error, render_action = :edit) if result if params[:commit] == "continue" flash.now[:notice] = notice else redirect_to(path, notice: notice) && return end else flash.now[:error] = error end render render_action end end
Version data entries
13 entries across 13 versions & 1 rubygems