Class: Signum::SignalController

Inherits:
ApplicationController show all
Defined in:
app/controllers/signum/signal_controller.rb

Instance Method Summary collapse

Instance Method Details

#closeObject



11
12
13
14
15
# File 'app/controllers/signum/signal_controller.rb', line 11

def close
  signal = Signum::Signal.find(signal_params[:id])
  signal.close!
  head :ok
end

#close_allObject



17
18
19
20
21
# File 'app/controllers/signum/signal_controller.rb', line 17

def close_all
  signals = Signum.config.current_user.call.signals.where.not(state: "closed")
  signals.each(&:close!)
  head :ok
end

#showObject



5
6
7
8
9
# File 'app/controllers/signum/signal_controller.rb', line 5

def show
  signal = Signum::Signal.find(signal_params[:id])
  signal.show! if signal.broadcasted?
  head :ok
end