diff --git a/app/assets/stylesheets/pages/_contacts.scss b/app/assets/stylesheets/pages/_contacts.scss index 89fe025..93c6e99 100644 --- a/app/assets/stylesheets/pages/_contacts.scss +++ b/app/assets/stylesheets/pages/_contacts.scss @@ -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; diff --git a/app/controllers/connections_controller.rb b/app/controllers/connections_controller.rb index f22135d..83a7e4e 100644 --- a/app/controllers/connections_controller.rb +++ b/app/controllers/connections_controller.rb @@ -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 diff --git a/app/views/pages/_contact.html.erb b/app/views/pages/_contact.html.erb index b4a1b9b..cc03a6c 100644 --- a/app/views/pages/_contact.html.erb +++ b/app/views/pages/_contact.html.erb @@ -20,6 +20,10 @@ <% end %> + <%= link_to connection_path(contact), method: :delete do %> + + <% end %> + diff --git a/app/views/pages/index.html.erb b/app/views/pages/index.html.erb index b7c7c93..9a1d490 100644 --- a/app/views/pages/index.html.erb +++ b/app/views/pages/index.html.erb @@ -19,6 +19,7 @@ +