From 5e054c67bc84c73cee35257da6309b21061acb42 Mon Sep 17 00:00:00 2001 From: Juzer Shakir Date: Tue, 13 Aug 2024 12:38:34 +0530 Subject: [PATCH 1/3] show `'open'` bounties by default at root path --- app/controllers/bounties_controller.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/controllers/bounties_controller.rb b/app/controllers/bounties_controller.rb index 13abfef..39a4327 100644 --- a/app/controllers/bounties_controller.rb +++ b/app/controllers/bounties_controller.rb @@ -5,6 +5,7 @@ class BountiesController < ApplicationController # GET /bounties or /bounties.json def index + params[:filter] = "open" if params[:filter].nil? @bounties = Bounty.sorted @filter, @bounties = params[:filter], @bounties.filtered(params[:filter]) if Bounty::STATUSES.include?(params[:filter]) @pagy, @bounties = pagy(@bounties) From 116ad8d5cd9c3149a69589653de101ef549f8e94 Mon Sep 17 00:00:00 2001 From: Juzer Shakir Date: Tue, 13 Aug 2024 12:39:30 +0530 Subject: [PATCH 2/3] set filter to '`none`' to fetch all bounties --- app/views/bounties/index.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/bounties/index.html.erb b/app/views/bounties/index.html.erb index 0f90da4..9b450eb 100644 --- a/app/views/bounties/index.html.erb +++ b/app/views/bounties/index.html.erb @@ -5,7 +5,7 @@

<%= (@filter || "All").titleize %> Bounties

-
- <%= render @bounties %> -
+<% if @bounties.present? %> +
+ <%= render @bounties %> +
-<%== pagy_nav(@pagy).html_safe %> + <%== pagy_nav(@pagy).html_safe %> +<% else %> + <% if @filter == "open" %> +

+ There are no open bounties right now. +
+ Spread the word that we need people to post new Beginner Bounties! +

+ <% end %> +<% end %>