Class: SolidObjects::InstancesController

Inherits:
ApplicationController show all
Defined in:
app/controllers/solid_objects/instances_controller.rb,
sig/generated/controllers/solid_objects/instances_controller.rbs

Instance Method Summary collapse

Methods inherited from ApplicationController

#authorize_administration!

Instance Method Details

#indexvoid

This method returns an undefined value.

RBS:

  • () -> void



6
7
8
9
10
11
12
# File 'app/controllers/solid_objects/instances_controller.rb', line 6

def index
  @instances = Instance.order(updated_at: :desc, id: :desc).limit(250)
  respond_to do |format|
    format.html
    format.json { render json: @instances }
  end
end

#showvoid

This method returns an undefined value.

RBS:

  • () -> void



15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'app/controllers/solid_objects/instances_controller.rb', line 15

def show
  @instance = Instance.find(params[:id])
  @messages = @instance.messages.order(sequence: :desc).limit(250)
  respond_to do |format|
    format.html
    format.json do
      render json: {
        instance: @instance,
        messages: @messages
      }
    end
  end
end