Sha256: 13b529d994d445480a99bbb2e646b8b636a1a7d6fac03b9d4928b441bd56a736

Contents?: true

Size: 641 Bytes

Versions: 1

Compression:

Stored size: 641 Bytes

Contents

module RailsWorkflow
  class ErrorsController < ActionController::Base

    def retry
      process = RailsWorkflow::Process.find(permitted_params[:process_id])

      if permitted_params[:operation_id].present?
        operation = Operation.find(permitted_params[:operation_id])
      end

      error = Error.find(permitted_params[:id])
      error.retry

      if operation.present?
        redirect_to process_operation_path(process, operation)
      else
        redirect_to process_path(process)
      end

    end

    protected
    def permitted_params
      parms = params.permit(:process_id, :operation_id, :id)
    end
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rails_workflow-0.2.1 app/controllers/rails_workflow/errors_controller.rb