Class: AtomicAdmin::AtomicLtiInstallController

Inherits:
ApplicationController show all
Defined in:
app/controllers/atomic_admin/atomic_lti_install_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject



15
16
17
# File 'app/controllers/atomic_admin/atomic_lti_install_controller.rb', line 15

def create
  AtomicLti::Install.create!(install_params)
end

#destroyObject



30
31
32
33
34
# File 'app/controllers/atomic_admin/atomic_lti_install_controller.rb', line 30

def destroy
  install = find_install
  install.destroy
  render json: install
end

#find_installObject



7
8
9
# File 'app/controllers/atomic_admin/atomic_lti_install_controller.rb', line 7

def find_install
  AtomicLti::Install.find_by(id: params[:id])
end

#indexObject



11
12
13
# File 'app/controllers/atomic_admin/atomic_lti_install_controller.rb', line 11

def index
  render json: AtomicLti::Install.all.order(:id).paginate(page: params[:page], per_page: 30)
end

#install_paramsObject



3
4
5
# File 'app/controllers/atomic_admin/atomic_lti_install_controller.rb', line 3

def install_params
  params.permit(:iss, :client_id)
end

#showObject



19
20
21
22
# File 'app/controllers/atomic_admin/atomic_lti_install_controller.rb', line 19

def show
  install = find_install
  render json: install
end

#updateObject



24
25
26
27
28
# File 'app/controllers/atomic_admin/atomic_lti_install_controller.rb', line 24

def update
  install = find_install
  result = install.update!(install_params)
  render json: result
end