diff --git a/Gemfile b/Gemfile index 8551c21..ffa11e3 100644 --- a/Gemfile +++ b/Gemfile @@ -16,6 +16,8 @@ gem 'sass-rails' gem 'simple_form' gem 'uglifier' gem 'webpacker' +gem 'cloudinary' +gem 'carrierwave', '~> 1.2' group :development do gem 'web-console', '>= 3.3.0' @@ -28,5 +30,4 @@ group :development, :test do gem 'spring' gem 'spring-watcher-listen', '~> 2.0.0' gem 'dotenv-rails' - gem 'dotenv-rails', groups: [:development, :test] end diff --git a/Gemfile.lock b/Gemfile.lock index a0193ad..ec82a00 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -45,6 +45,7 @@ GEM arel (9.0.0) autoprefixer-rails (9.1.3) execjs + aws_cf_signer (0.1.3) bcrypt (3.1.12) bindex (0.5.0) bootsnap (1.3.1) @@ -54,6 +55,13 @@ GEM sass (>= 3.3.4) builder (3.2.3) byebug (10.0.2) + carrierwave (1.2.3) + activemodel (>= 4.0.0) + activesupport (>= 4.0.0) + mime-types (>= 1.16) + cloudinary (1.9.1) + aws_cf_signer + rest-client coderay (1.1.2) concurrent-ruby (1.0.5) crass (1.0.4) @@ -63,6 +71,8 @@ GEM railties (>= 4.1.0, < 6.0) responders warden (~> 1.2.3) + domain_name (0.5.20180417) + unf (>= 0.0.5, < 1.0.0) dotenv (2.5.0) dotenv-rails (2.5.0) dotenv (= 2.5.0) @@ -74,6 +84,8 @@ GEM sassc (>= 1.11) globalid (0.4.1) activesupport (>= 4.2.0) + http-cookie (1.0.3) + domain_name (~> 0.5) i18n (1.1.0) concurrent-ruby (~> 1.0) jbuilder (2.7.0) @@ -90,12 +102,16 @@ GEM marcel (0.3.2) mimemagic (~> 0.3.2) method_source (0.9.0) + mime-types (3.2.2) + mime-types-data (~> 3.2015) + mime-types-data (3.2018.0812) mimemagic (0.3.2) mini_mime (1.0.1) mini_portile2 (2.3.0) minitest (5.11.3) msgpack (1.2.4) multi_json (1.13.1) + netrc (0.11.0) nio4r (2.3.1) nokogiri (1.8.4) mini_portile2 (~> 2.3.0) @@ -147,6 +163,10 @@ GEM responders (2.4.0) actionpack (>= 4.2.0, < 5.3) railties (>= 4.2.0, < 5.3) + rest-client (2.0.2) + http-cookie (>= 1.0.2, < 2.0) + mime-types (>= 1.16, < 4.0) + netrc (~> 0.8) sass (3.5.7) sass-listen (~> 4.0.0) sass-listen (4.0.0) @@ -183,6 +203,9 @@ GEM thread_safe (~> 0.1) uglifier (4.1.18) execjs (>= 0.3.0, < 3) + unf (0.1.4) + unf_ext + unf_ext (0.0.7.5) warden (1.2.7) rack (>= 1.0) web-console (3.6.2) @@ -205,6 +228,8 @@ DEPENDENCIES autoprefixer-rails bootsnap bootstrap-sass (~> 3.3) + carrierwave (~> 1.2) + cloudinary devise dotenv-rails font-awesome-sass (~> 5.0.9) diff --git a/app/models/user.rb b/app/models/user.rb index 18122b7..265a42b 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -7,6 +7,8 @@ class User < ApplicationRecord has_many :connections + mount_uploader :photo, PhotoUploader + def contacts self.connections.map do |connection| connection.contact diff --git a/app/uploaders/photo_uploader.rb b/app/uploaders/photo_uploader.rb new file mode 100644 index 0000000..a700b37 --- /dev/null +++ b/app/uploaders/photo_uploader.rb @@ -0,0 +1,3 @@ +class PhotoUploader < CarrierWave::Uploader::Base + include Cloudinary::CarrierWave +end diff --git a/app/views/shared/_navbar.html.erb b/app/views/shared/_navbar.html.erb index e14295a..6810141 100644 --- a/app/views/shared/_navbar.html.erb +++ b/app/views/shared/_navbar.html.erb @@ -5,7 +5,7 @@
@@ -14,10 +14,10 @@ <% else %>