diff --git a/Gemfile b/Gemfile index cd467b5..e88827b 100644 --- a/Gemfile +++ b/Gemfile @@ -4,6 +4,7 @@ git_source(:github) { |repo| "https://github.com/#{repo}.git" } ruby '2.7.8' # Bundle edge Rails instead: gem 'rails', github: 'rails/rails' + gem 'rails', '~> 7.1' # Use sqlite3 as the database for Active Record gem 'sqlite3', '~> 1.4' @@ -40,8 +41,10 @@ end group :development do # Access an interactive console on exception pages or by calling 'console' anywhere in the code. + gem 'web-console', '>= 4.2.1' gem 'listen', '~> 3.9' + # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring gem 'spring' gem 'spring-watcher-listen', '~> 2.0.0' @@ -58,3 +61,4 @@ end # Windows does not include zoneinfo files, so bundle the tzinfo-data gem gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby] gem 'rubocop', '~> 0.89.1' + diff --git a/Gemfile.lock b/Gemfile.lock index d32eddd..1885818 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -75,15 +75,15 @@ GEM minitest (>= 5.1) mutex_m tzinfo (~> 2.0) - addressable (2.8.6) - public_suffix (>= 2.0.2, < 6.0) + addressable (2.8.7) + public_suffix (>= 2.0.2, < 7.0) ast (2.4.2) base64 (0.2.0) bigdecimal (3.1.8) bindex (0.8.1) bootsnap (1.18.3) msgpack (~> 1.2) - builder (3.2.4) + builder (3.3.0) byebug (11.1.3) capybara (3.39.2) addressable @@ -94,12 +94,12 @@ GEM rack-test (>= 0.6.3) regexp_parser (>= 1.5, < 3.0) xpath (~> 3.2) - concurrent-ruby (1.3.1) + concurrent-ruby (1.3.3) connection_pool (2.4.1) crass (1.0.6) date (3.3.4) drb (2.2.1) - erubi (1.12.0) + erubi (1.13.0) faraday (2.8.1) base64 faraday-net_http (>= 2.0, < 3.1) @@ -111,15 +111,15 @@ GEM graphlient (0.8.0) faraday (~> 2.0) graphql-client - graphql (2.3.4) + graphql (2.3.9) base64 - graphql-client (0.22.0) + graphql-client (0.23.0) activesupport (>= 3.0) graphql (>= 1.13.0) i18n (1.14.5) concurrent-ruby (~> 1.0) io-console (0.7.2) - irb (1.13.1) + irb (1.14.0) rdoc (>= 4.0.0) reline (>= 0.4.2) jbuilder (2.12.0) @@ -140,10 +140,10 @@ GEM matrix (0.4.2) mini_mime (1.1.5) mini_portile2 (2.8.7) - minitest (5.23.1) + minitest (5.24.1) msgpack (1.7.2) mutex_m (0.2.0) - net-imap (0.4.12) + net-imap (0.4.14) date net-protocol net-pop (0.1.2) @@ -155,17 +155,17 @@ GEM nio4r (2.7.3) nokogiri (1.15.6-arm64-darwin) racc (~> 1.4) - parallel (1.24.0) - parser (3.3.2.0) + parallel (1.25.1) + parser (3.3.4.0) ast (~> 2.4.1) racc psych (5.1.2) stringio - public_suffix (5.0.5) + public_suffix (5.1.1) puma (6.4.2) nio4r (~> 2.0) racc (1.8.0) - rack (3.0.11) + rack (3.1.7) rack-proxy (0.7.7) rack rack-session (2.0.0) @@ -212,10 +212,10 @@ GEM rdoc (6.7.0) psych (>= 4.0.0) regexp_parser (2.9.2) - reline (0.5.8) + reline (0.5.9) io-console (~> 0.5) - rexml (3.2.8) - strscan (>= 3.0.9) + rexml (3.3.2) + strscan rubocop (0.89.1) parallel (~> 1.10) parser (>= 2.7.1.1) @@ -252,16 +252,16 @@ GEM sprockets (4.2.1) concurrent-ruby (~> 1.0) rack (>= 2.2.4, < 4) - sprockets-rails (3.5.0) + sprockets-rails (3.5.1) actionpack (>= 6.1) activesupport (>= 6.1) sprockets (>= 3.0.0) sqlite3 (1.7.3) mini_portile2 (~> 2.8.0) - stringio (3.1.0) + stringio (3.1.1) strscan (3.1.0) thor (1.3.1) - tilt (2.3.0) + tilt (2.4.0) timeout (0.4.1) turbolinks (5.2.1) turbolinks-source (~> 5.2) @@ -284,13 +284,13 @@ GEM railties (>= 5.2) semantic_range (>= 2.3.0) webrick (1.8.1) - websocket (1.2.10) + websocket (1.2.11) websocket-driver (0.7.6) websocket-extensions (>= 0.1.0) websocket-extensions (0.1.5) xpath (3.2.0) nokogiri (~> 1.8) - zeitwerk (2.6.15) + zeitwerk (2.6.16) PLATFORMS arm64-darwin-22 diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 1e1aa8a..a5d557c 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -1,5 +1,5 @@ # Application controller file class ApplicationController < ActionController::Base - # Enable CSRF protection - protect_from_forgery with: :exception + # Enable CSRF protection + protect_from_forgery with: :exception end diff --git a/app/views/products/index.html.erb b/app/views/products/index.html.erb index b661940..68977f2 100644 --- a/app/views/products/index.html.erb +++ b/app/views/products/index.html.erb @@ -18,10 +18,9 @@ <% all_product.items.each do |product| %>
  • + <%= image_tag product.featured_image_connection.edges[0].node.url, alt: product.featured_image_connection.edges[0].node.filename %> - -

    <%= product.title %>

    diff --git a/config/environments/development.rb b/config/environments/development.rb index 8cd30f0..cfbbe31 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -12,7 +12,7 @@ config.webpacker.check_yarn_integrity = false # Show full error reports. - config.consider_all_requests_local = true + config.consider_all_requests_local = false # Enable/disable caching. By default caching is disabled. # Run rails dev:cache to toggle caching. diff --git a/config/environments/test.rb b/config/environments/test.rb index f858827..1fcd194 100644 --- a/config/environments/test.rb +++ b/config/environments/test.rb @@ -20,7 +20,8 @@ } # Show full error reports and disable caching. - config.consider_all_requests_local = false + config.consider_all_requests_local = false + config.action_controller.perform_caching = false config.cache_store = :null_store diff --git a/config/routes.rb b/config/routes.rb index 4f9b1f4..b3869d2 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -2,7 +2,9 @@ resources :products do end get '/', to: redirect('/products') + # Custom error routes match '/404', to: 'errors#not_found', via: :all match '/500', to: 'errors#internal_server_error', via: :all + end