app/controllers/workshops_controller.rb
# Remove a user from this workshop, either to the attendees or the waiting list.
Remove a user from this workshop, either to the attendees or the waiting list.
Remove a user from this workshop either to the attendees or the waiting list .
def remove
    workshop = Sessions.find(params[:id])
    SessionInvitation.where(sessions: workshop, member: current_user).each do |i|
      i.update_attribute(:attending, false)
      waiting_list = WaitingList.find_by_invitation_id(i.id)
      waiting_list.delete if waiting_list
    end
    redirect_to removed_workshop_path(workshop) and return
  end
def remove workshop = Sessions . find ( params [ :id ] ) SessionInvitation . where ( sessions : workshop , member : current_user ) . each do | i | i . update_attribute ( :attending , false ) waiting_list = WaitingList . find_by_invitation_id ( i . id ) waiting_list . delete if waiting_list end redirect_to removed_workshop_path ( workshop ) and return end
Remove a user from this workshop, either to the attendees or the waiting list.
Remove a user from this workshop either to the attendees or the waiting list .