Class: Admin::Operations::ActionsController

Inherits:
ApplicationController
  • Object
show all
Defined in:
app/controllers/admin/operations/actions_controller.rb

Instance Method Summary collapse

Instance Method Details

#detailsObject



14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'app/controllers/admin/operations/actions_controller.rb', line 14

def details
  operation = Operations.from_uuid(params[:uuid])
  if operation
    users = operation.users
    if users
      render json: {success: true, operation: operation, users: users}
    else
      render json: {success: false, message: "Operation with UUID `#{params[:uuid]}' is not valid."}
    end
  else
    render json: {success: false, message: "Operation with UUID `#{params[:uuid]}' not found."}
  end
end

#indexObject



3
4
5
6
7
8
9
10
11
12
# File 'app/controllers/admin/operations/actions_controller.rb', line 3

def index
  @actions = Operations.operations_list
  respond_to do |format|
    format.html {
      @editing = params[:edit].to_s.downcase.strip == 'true'
      @editing_title = @editing ? 'Manage actions' : 'View actions'
    }
    format.json { render json: @actions }
  end
end