diff --git a/Gemfile b/Gemfile index e2b87168..405a659d 100644 --- a/Gemfile +++ b/Gemfile @@ -41,7 +41,7 @@ gem 'mini_magick', '4.7.0' gem 'fog', '1.40.0' # Forms country select. -gem 'country_select' +gem 'country_select', '~> 3.1', '>= 3.1.1' # Geolocalization. gem 'geocoder', '~> 1.4', '>= 1.4.5' diff --git a/Gemfile.lock b/Gemfile.lock index 6634c74e..ffbf3aa7 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -2,41 +2,41 @@ GEM remote: https://rubygems.org/ specs: CFPropertyList (2.3.6) - actioncable (5.1.5) - actionpack (= 5.1.5) + actioncable (5.1.6) + actionpack (= 5.1.6) nio4r (~> 2.0) websocket-driver (~> 0.6.1) - actionmailer (5.1.5) - actionpack (= 5.1.5) - actionview (= 5.1.5) - activejob (= 5.1.5) + actionmailer (5.1.6) + actionpack (= 5.1.6) + actionview (= 5.1.6) + activejob (= 5.1.6) mail (~> 2.5, >= 2.5.4) rails-dom-testing (~> 2.0) - actionpack (5.1.5) - actionview (= 5.1.5) - activesupport (= 5.1.5) + actionpack (5.1.6) + actionview (= 5.1.6) + activesupport (= 5.1.6) rack (~> 2.0) rack-test (>= 0.6.3) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.0, >= 1.0.2) - actionview (5.1.5) - activesupport (= 5.1.5) + actionview (5.1.6) + activesupport (= 5.1.6) builder (~> 3.1) erubi (~> 1.4) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.0, >= 1.0.3) - activejob (5.1.5) - activesupport (= 5.1.5) + activejob (5.1.6) + activesupport (= 5.1.6) globalid (>= 0.3.6) - activemodel (5.1.5) - activesupport (= 5.1.5) - activerecord (5.1.5) - activemodel (= 5.1.5) - activesupport (= 5.1.5) + activemodel (5.1.6) + activesupport (= 5.1.6) + activerecord (5.1.6) + activemodel (= 5.1.6) + activesupport (= 5.1.6) arel (~> 8.0) - activesupport (5.1.5) + activesupport (5.1.6) concurrent-ruby (~> 1.0, >= 1.0.2) - i18n (~> 0.7) + i18n (>= 0.7, < 2) minitest (~> 5.1) tzinfo (~> 1.1) addressable (2.5.2) @@ -60,7 +60,7 @@ GEM will_paginate breadcrumbs_on_rails (3.0.1) builder (3.2.3) - byebug (10.0.1) + byebug (10.0.2) capybara (2.18.0) addressable mini_mime (>= 0.1.3) @@ -114,7 +114,7 @@ GEM equalizer (0.0.11) erubi (1.7.1) eventmachine (1.2.5) - excon (0.61.0) + excon (0.62.0) execjs (2.7.0) faker (1.8.7) i18n (>= 0.7) @@ -306,7 +306,7 @@ GEM loofah (2.2.2) crass (~> 1.0.2) nokogiri (>= 1.5.9) - lumberjack (1.0.12) + lumberjack (1.0.13) mail (2.7.0) mini_mime (>= 0.1.1) method_source (0.9.0) @@ -334,7 +334,7 @@ GEM shellany (~> 0.0) orm_adapter (0.5.0) parallel (1.12.1) - parser (2.5.0.4) + parser (2.5.0.5) ast (~> 2.4.0) pg (0.21.0) popper_js (1.12.9) @@ -352,19 +352,19 @@ GEM pundit (1.1.0) activesupport (>= 3.0.0) rack (2.0.4) - rack-test (0.8.3) + rack-test (1.0.0) rack (>= 1.0, < 3) - rails (5.1.5) - actioncable (= 5.1.5) - actionmailer (= 5.1.5) - actionpack (= 5.1.5) - actionview (= 5.1.5) - activejob (= 5.1.5) - activemodel (= 5.1.5) - activerecord (= 5.1.5) - activesupport (= 5.1.5) + rails (5.1.6) + actioncable (= 5.1.6) + actionmailer (= 5.1.6) + actionpack (= 5.1.6) + actionview (= 5.1.6) + activejob (= 5.1.6) + activemodel (= 5.1.6) + activerecord (= 5.1.6) + activesupport (= 5.1.6) bundler (>= 1.3.0) - railties (= 5.1.5) + railties (= 5.1.6) sprockets-rails (>= 2.0.0) rails-controller-testing (1.0.2) actionpack (~> 5.x, >= 5.0.1) @@ -380,9 +380,9 @@ GEM ruby-graphviz (~> 1.2) rails-html-sanitizer (1.0.4) loofah (~> 2.2, >= 2.2.2) - railties (5.1.5) - actionpack (= 5.1.5) - activesupport (= 5.1.5) + railties (5.1.6) + actionpack (= 5.1.6) + activesupport (= 5.1.6) method_source rake (>= 0.8.7) thor (>= 0.18.1, < 2.0) @@ -496,7 +496,7 @@ DEPENDENCIES capybara-webkit (~> 1.15) carrierwave (= 1.1.0) coffee-rails (~> 4.2) - country_select + country_select (~> 3.1, >= 3.1.1) devise (~> 4.4, >= 4.4.3) faker (~> 1.8, >= 1.8.7) figaro (~> 1.1, >= 1.1.1) diff --git a/app/controllers/groups_controller.rb b/app/controllers/groups_controller.rb index ce44a2ad..9420ad50 100644 --- a/app/controllers/groups_controller.rb +++ b/app/controllers/groups_controller.rb @@ -65,7 +65,7 @@ def destroy def group_params params.require(:group) .permit( - :name, :description, :image, + :name, :city, :description, :image, :private, :hidden, :all_members_can_create_events ) end diff --git a/app/models/group.rb b/app/models/group.rb index dc10b27e..17484179 100644 --- a/app/models/group.rb +++ b/app/models/group.rb @@ -17,6 +17,7 @@ class Group < ApplicationRecord mount_uploader :image, ImageUploader validates :name, presence: true, length: { minimum: 3 } + validates :city, presence: true, length: { minimum: 3 } validates :description, presence: true, length: { minimum: 70 } validates :image, presence: true diff --git a/app/views/groups/_form.html.erb b/app/views/groups/_form.html.erb index b7b82b89..a7132f9a 100644 --- a/app/views/groups/_form.html.erb +++ b/app/views/groups/_form.html.erb @@ -11,6 +11,12 @@ required: true %> +
+ <%= @group.city %> +
+