Merge pull request #46 from beatriceo/cross

done
This commit is contained in:
Benjamin Myara 2018-09-03 15:19:12 +01:00 committed by GitHub
commit 08de4ca536
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 27 additions and 3 deletions

View File

@ -6,7 +6,8 @@ a:hover {
display: flex;
justify-content: space-between;
a {
align-self: flex-end;
align-self: center;
margin-top: 19px;
}
}
@ -164,12 +165,24 @@ a:hover {
}
.contacts {
display: flex;
flex-direction: column;
justify-content: center;
}
.close {
margin-right: 8px;
margin-top: -46px;
float: right;
font-size: 27px;
font-weight: bold;
line-height: 1;
color: #F55E4F;
text-shadow: 0 1px 0 #000;
opacity: 0.8;
filter: alpha(opacity=20);
}
.contacts-list{
height: 90vh;
overflow: scroll;

View File

@ -22,4 +22,10 @@ class ConnectionsController < ApplicationController
render 'new'
end
end
def destroy
connection = current_user.connections.find_by(contact_id: params[:id].to_i)
connection.destroy
redirect_to root_path
end
end

View File

@ -20,6 +20,10 @@
<i class="fas fa-phone"></i>
<% end %>
</div>
<%= link_to connection_path(contact), method: :delete do %>
<button type="button" class="close" data-dismiss="modal" aria-label="close"><span aria-hidden="true">×</span></button>
<% end %>
</div>
<!-- Modal -->

View File

@ -19,6 +19,7 @@
</div>
</div>
</div>
<div class="col-xs-12 col-md-6 hidden-xs hidden-sm">
<div class="video-feed">
<div class="video-content">

View File

@ -41,6 +41,6 @@ Rails.application.routes.draw do
patch '/users/:id', to: 'users#update'
delete '/users/:id', to: 'users#destroy'
resources :connections, only: [:create]
resources :connections, only: [:create, :destroy]
get '/add_contact', to: 'connections#new', as: :add_contact
end