diff --git a/app/assets/stylesheets/application.scss b/app/assets/stylesheets/application.scss index 69a430a..85986ae 100755 --- a/app/assets/stylesheets/application.scss +++ b/app/assets/stylesheets/application.scss @@ -20,3 +20,5 @@ body { } @import "devise/index"; @import "users/index"; +@import "connections/index"; + diff --git a/app/assets/stylesheets/connections/_index.scss b/app/assets/stylesheets/connections/_index.scss new file mode 100644 index 0000000..84cb37e --- /dev/null +++ b/app/assets/stylesheets/connections/_index.scss @@ -0,0 +1 @@ +@import 'new'; diff --git a/app/assets/stylesheets/connections/_new.scss b/app/assets/stylesheets/connections/_new.scss new file mode 100644 index 0000000..37fdd9a --- /dev/null +++ b/app/assets/stylesheets/connections/_new.scss @@ -0,0 +1,11 @@ +.align-center { + justify-content: center; + text-align: center; + h2 { + color: white; + } +} +.email { + color: white; +} + diff --git a/app/assets/stylesheets/pages/_contacts.scss b/app/assets/stylesheets/pages/_contacts.scss index b1de415..b4c303f 100644 --- a/app/assets/stylesheets/pages/_contacts.scss +++ b/app/assets/stylesheets/pages/_contacts.scss @@ -2,6 +2,14 @@ a:hover { text-decoration: none; } +.contacts-header { + display: flex; + justify-content: space-between; + a { + align-self: flex-end; + } +} + .card { display: flex; justify-content: space-between; diff --git a/app/controllers/connections_controller.rb b/app/controllers/connections_controller.rb new file mode 100644 index 0000000..0a8b48b --- /dev/null +++ b/app/controllers/connections_controller.rb @@ -0,0 +1,18 @@ +class ConnectionsController < ApplicationController + def new + + end + + def create + @connection = Connection.new + @connection.user = current_user + contact_user = User.find_by(email: params[:user][:email]) + @connection.contact = contact_user + + if @connection.save + redirect_to contacts_path + else + + end + end +end diff --git a/app/controllers/pages_controller.rb b/app/controllers/pages_controller.rb index e7676ac..dd8b1f4 100644 --- a/app/controllers/pages_controller.rb +++ b/app/controllers/pages_controller.rb @@ -6,11 +6,15 @@ class PagesController < ApplicationController end def index + @contact = Connection.new end def home end + + + def cable_testing chatroom = 'chat_room_' + params[:chat_room_id] puts params diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index d1090e6..ad2a68f 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -31,6 +31,7 @@ class UsersController < ApplicationController end + private def find_user diff --git a/app/views/connections/new.html.erb b/app/views/connections/new.html.erb new file mode 100644 index 0000000..7963a7c --- /dev/null +++ b/app/views/connections/new.html.erb @@ -0,0 +1,9 @@ +
<%= contact.email %>
diff --git a/app/views/pages/index.html.erb b/app/views/pages/index.html.erb index a7c5547..715f64a 100644 --- a/app/views/pages/index.html.erb +++ b/app/views/pages/index.html.erb @@ -1,10 +1,18 @@