Class: Admin::EventMaterialsController

Inherits:
AdminController
  • Object
show all
Defined in:
app/controllers/admin/event_materials_controller.rb

Instance Method Summary collapse

Instance Method Details

#toggleObject

post /admin/event_materials/:id/toggle



5
6
7
8
9
10
11
# File 'app/controllers/admin/event_materials_controller.rb', line 5

def toggle
  if @entity.locked?
    render json: { errors: { locked: @entity.locked } }, status: :forbidden
  else
    render json: { data: @entity.toggle_parameter(params[:parameter].to_s) }
  end
end