From 94a4b67675a121a07938506a8ec3e5a6bd92e45c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sen=C3=A9n=20Rodero=20Rodr=C3=ADguez?= Date: Mon, 18 Jan 2021 17:35:47 +0100 Subject: [PATCH] Use local variables at `shared/filter_subnav` partial So we can use it from components too. --- app/controllers/concerns/has_filters.rb | 5 +++++ app/views/shared/_filter_subnav.html.erb | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/app/controllers/concerns/has_filters.rb b/app/controllers/concerns/has_filters.rb index ea5397183..d12058fc4 100644 --- a/app/controllers/concerns/has_filters.rb +++ b/app/controllers/concerns/has_filters.rb @@ -1,5 +1,10 @@ module HasFilters extend ActiveSupport::Concern + attr_reader :valid_filters, :current_filter + + included do + helper_method :valid_filters, :current_filter + end class_methods do def has_filters(valid_filters, *args) diff --git a/app/views/shared/_filter_subnav.html.erb b/app/views/shared/_filter_subnav.html.erb index 66d5ac273..fc4c5a950 100644 --- a/app/views/shared/_filter_subnav.html.erb +++ b/app/views/shared/_filter_subnav.html.erb @@ -1,8 +1,8 @@