diff --git a/app/assets/stylesheets/application.css.scss b/app/assets/stylesheets/application.css.scss index 7a7cf08..5b720f7 100644 --- a/app/assets/stylesheets/application.css.scss +++ b/app/assets/stylesheets/application.css.scss @@ -35,7 +35,8 @@ body { font-weight: 100; display: flex; flex-direction: column; - min-height: 100vh; + /* stylelint-disable-next-line */ + min-height: 100dvh; min-width: 300px; } diff --git a/app/controllers/groups_controller.rb b/app/controllers/groups_controller.rb index f367651..ad0ac12 100644 --- a/app/controllers/groups_controller.rb +++ b/app/controllers/groups_controller.rb @@ -3,8 +3,6 @@ def index @groups = current_user.groups end - def show; end - def new @group = Group.new end @@ -46,6 +44,8 @@ def destroy end end + private + def group_params params.require(:group).permit(:name, :icon) end diff --git a/app/controllers/purchases_controller.rb b/app/controllers/purchases_controller.rb index e5dd7d1..ffa2e12 100644 --- a/app/controllers/purchases_controller.rb +++ b/app/controllers/purchases_controller.rb @@ -64,6 +64,8 @@ def destroy end end + private + def purchase_params params.require(:purchase).permit(:name, :amount, group_ids: []) end diff --git a/app/views/devise/registrations/new.html.erb b/app/views/devise/registrations/new.html.erb index b4d8b3b..f1dd504 100644 --- a/app/views/devise/registrations/new.html.erb +++ b/app/views/devise/registrations/new.html.erb @@ -2,7 +2,7 @@ <%= link_to pages_splash_path, data: { turbo: false } do %> <%= inline_svg_tag "chevron_left.svg", class: "chevron" %> <% end %> -

sing up

+

sign up

<%= inline_svg_tag "menu.svg", class: "burger-menu" %>
diff --git a/app/views/purchases/index.html.erb b/app/views/purchases/index.html.erb index e81cb11..7a95219 100644 --- a/app/views/purchases/index.html.erb +++ b/app/views/purchases/index.html.erb @@ -18,7 +18,7 @@ <%= image_tag(check_url(@group.icon), class: 'icon', alt: 'group_icon') %>
<%= @group.name %> - + $<%= total_amount(@group)%> <%= @group.created_at.strftime('%d %b %Y') %>
<% end %> @@ -31,7 +31,7 @@ <% end %> -
- total expences: - $<%= total_amount(@group)%> -
diff --git a/config/environments/development.rb b/config/environments/development.rb index f1a64af..3705d84 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -1,6 +1,15 @@ require "active_support/core_ext/integer/time" Rails.application.configure do + config.after_initialize do + Bullet.enable = true + Bullet.alert = true + Bullet.bullet_logger = true + Bullet.console = true + Bullet.rails_logger = true + Bullet.add_footer = true + end + # Settings specified here will take precedence over those in config/application.rb. # In the development environment your application's code is reloaded any time diff --git a/config/environments/test.rb b/config/environments/test.rb index 553da5b..b0f0106 100644 --- a/config/environments/test.rb +++ b/config/environments/test.rb @@ -1,4 +1,5 @@ require "active_support/core_ext/integer/time" +require 'bullet' # The test environment is used exclusively to run your application's # test suite. You never need to work with it otherwise. Remember that @@ -6,6 +7,12 @@ # and recreated between test runs. Don't rely on the data there! Rails.application.configure do + config.after_initialize do + Bullet.enable = true + Bullet.bullet_logger = true + Bullet.raise = true # raise an error if n+1 query occurs + end + # Settings specified here will take precedence over those in config/application.rb. # While tests run files are not watched, reloading is not necessary. diff --git a/config/routes.rb b/config/routes.rb index 4d0104a..eef43dc 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -20,7 +20,7 @@ end end - resources :groups do + resources :groups, only: [:index, :new, :create, :edit, :update, :destroy] do resources :purchases end