Class: Pushable::ConsolesController

Inherits:
ActionController::Base
  • Object
show all
Defined in:
app/controllers/pushable/consoles_controller.rb

Instance Method Summary collapse

Instance Method Details

#pushObject



19
20
21
22
23
24
25
26
27
28
# File 'app/controllers/pushable/consoles_controller.rb', line 19

def push
  @push = Pushable::ConsolePush.new permitted_params
  if @push.valid? && @push.deliver
    flash[:notice] = "Push delivered (sent to #{@push.sent_count} recipient(s))."
  else
    flash[:alert] = "Push failed! #{@push.errors.full_messages.to_sentence}."
  end
  show
  render :show
end

#showObject



13
14
15
16
17
# File 'app/controllers/pushable/consoles_controller.rb', line 13

def show
  @push = Pushable::ConsolePush.new
  @stubs = Pushable::Console.stubs
  @klasses = @stubs.map(&:klass)
end