Newer
Older
before_action :authenticate_user!
disconnect_if_contact(block.person) if block.save
respond_with do |format|
format.json{ render :nothing => true, :status => 204 }
end
def destroy
current_user.blocks.find(params[:id]).delete
respond_with do |format|
format.json{ render :nothing => true, :status => 204 }
end
end
def disconnect_if_contact(person)
current_user.contact_for(person).try {|contact| current_user.disconnect(contact) }
def block_params
params.require(:block).permit(:person_id)
end