Class: Hyperlayer::PathsController

Inherits:
ApplicationController show all
Defined in:
app/controllers/hyperlayer/paths_controller.rb

Instance Method Summary collapse

Instance Method Details

#indexObject



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

def index
  # @paths = Path.includes(:events).all.limit(500).order(id: :asc)

  @paths = [
    { id: '1', position: { x: 0, y: 0 }, data: { label: '1' } },
    { id: '2', position: { x: 0, y: 75 }, data: { label: '2' } },
  ]

  render json: @paths.to_json
end

#showObject



14
15
16
# File 'app/controllers/hyperlayer/paths_controller.rb', line 14

def show
  @path = Path.find(params[:id])
end