Clearer about where these are being sent
This commit is contained in:
@@ -6,20 +6,20 @@ class Cards::PinsController < ApplicationController
|
||||
|
||||
def create
|
||||
pin = @card.pin_by Current.user
|
||||
broadcast_my_new pin
|
||||
broadcast_add_to_tray pin
|
||||
end
|
||||
|
||||
def destroy
|
||||
pin = @card.unpin_by Current.user
|
||||
broadcast_my_removed pin
|
||||
broadcast_remove_from_tray pin
|
||||
end
|
||||
|
||||
private
|
||||
def broadcast_my_new(pin)
|
||||
def broadcast_add_to_tray(pin)
|
||||
pin.broadcast_prepend_later_to [ Current.user, :pins ], target: "pins", partial: "my/pins/pin"
|
||||
end
|
||||
|
||||
def broadcast_my_removed(pin)
|
||||
def broadcast_remove_from_tray(pin)
|
||||
pin.broadcast_remove_to [ Current.user, :pins ]
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user