From e4e6a5c7fbce65dbb91030a9807bfc776fda1430 Mon Sep 17 00:00:00 2001 From: Nelson Jovel Date: Fri, 26 Jan 2024 10:38:45 -0800 Subject: [PATCH] chore: show browse page without errors --- Gemfile | 3 ++- Gemfile.lock | 13 +++++++++++-- app/controllers/dashboard/categories_controller.rb | 1 + app/helpers/dashboard/header_helper.rb | 2 +- app/views/dashboard/categories/show.html.erb | 1 + 5 files changed, 16 insertions(+), 4 deletions(-) diff --git a/Gemfile b/Gemfile index 2ca770f..914595a 100644 --- a/Gemfile +++ b/Gemfile @@ -11,7 +11,8 @@ gem "pg" gem "sprockets-rails" group :development, :test do - gem "byebug" + gem "debug" + gem "web-console" end # Start debugger with binding.b [https://github.com/ruby/debug] # gem "debug", ">= 1.0.0" diff --git a/Gemfile.lock b/Gemfile.lock index 1fd12cc..427f3dd 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -95,14 +95,17 @@ GEM base64 (0.2.0) bcrypt_pbkdf (1.1.0) bigdecimal (3.1.5) + bindex (0.8.1) builder (3.2.4) - byebug (11.1.3) concurrent-ruby (1.2.2) connection_pool (2.4.1) crass (1.0.6) cssbundling-rails (1.3.3) railties (>= 6.0.0) date (3.3.4) + debug (1.9.1) + irb (~> 1.10) + reline (>= 0.3.8) diff-lcs (1.5.0) drb (2.2.0) ruby2_keywords @@ -247,6 +250,11 @@ GEM watir (7.3.0) regexp_parser (>= 1.2, < 3) selenium-webdriver (~> 4.2) + web-console (4.2.1) + actionview (>= 6.0.0) + activemodel (>= 6.0.0) + bindex (>= 0.4.0) + railties (>= 6.0.0) webrick (1.8.1) websocket (1.2.10) websocket-driver (0.7.6) @@ -258,12 +266,13 @@ PLATFORMS x86_64-linux DEPENDENCIES - byebug dashboard! + debug factory_bot_rails pg puma sprockets-rails + web-console BUNDLED WITH 2.4.21 diff --git a/app/controllers/dashboard/categories_controller.rb b/app/controllers/dashboard/categories_controller.rb index a87e8cd..ba9d5da 100644 --- a/app/controllers/dashboard/categories_controller.rb +++ b/app/controllers/dashboard/categories_controller.rb @@ -7,6 +7,7 @@ module Dashboard def show @categories = Category.sorted.map { |category| CategoryPresenter.new(category:) } + puts params @category = CategoryPresenter.new(category: Category.find_by_slug(params[:id])) end end diff --git a/app/helpers/dashboard/header_helper.rb b/app/helpers/dashboard/header_helper.rb index c19d6bc..324ff58 100644 --- a/app/helpers/dashboard/header_helper.rb +++ b/app/helpers/dashboard/header_helper.rb @@ -7,7 +7,7 @@ module Dashboard end def link_to_browse(district:, school:, academic_year:) - "/districts/#{district.slug}/schools/#{school.slug}/browse/teachers-and-leadership?year=#{academic_year.range}" + "/districts/#{district.slug}/schools/#{school.slug}/browse/teachers-leadership?year=#{academic_year.range}" end def link_to_analyze(district:, school:, academic_year:) diff --git a/app/views/dashboard/categories/show.html.erb b/app/views/dashboard/categories/show.html.erb index ba9a841..2629c1d 100644 --- a/app/views/dashboard/categories/show.html.erb +++ b/app/views/dashboard/categories/show.html.erb @@ -9,6 +9,7 @@ <% end %> +<% console %>