Merge branch 'master' into cross

This commit is contained in:
Benjamin Myara
2018-09-03 15:19:04 +01:00
committed by GitHub
47 changed files with 700 additions and 614 deletions

View File

@@ -6,4 +6,8 @@ class ApplicationController < ActionController::Base
def after_sign_in_path_for(resource)
contacts_path
end
def default_url_options
{ host: ENV["HOST"] || "localhost:3000" }
end
end

View File

@@ -1,6 +1,5 @@
class ConnectionsController < ApplicationController
def new
end
def create
@@ -10,9 +9,17 @@ class ConnectionsController < ApplicationController
@connection.contact = contact_user
if @connection.save
redirect_to contacts_path
contact_message = nil
if contact_user.first_name.nil? || contact_user.last_name.nil?
contact_message = "#{contact_user.email}"
else
contact_message = "#{contact_user.first_name} #{contact_user.last_name}"
end
flash[:notice] = "Added #{contact_message} to contacts"
redirect_to contacts_path
else
flash[:alert] = "Invalid email address!"
render 'new'
end
end

View File

@@ -13,8 +13,6 @@ class PagesController < ApplicationController
end
def cable_testing
chatroom = 'chat_room_' + params[:chat_room_id]
puts params