Allow different labels in admin search component

This commit is contained in:
Javi Martín
2020-12-03 15:50:12 +01:00
parent 0a3acf3c5f
commit 9b073599f0
2 changed files with 4 additions and 7 deletions

View File

@@ -1,8 +1,9 @@
class Admin::SearchComponent < ApplicationComponent
attr_reader :url
attr_reader :url, :label
def initialize(url:)
def initialize(url:, label:)
@url = url
@label = label
end
private
@@ -10,8 +11,4 @@ class Admin::SearchComponent < ApplicationComponent
def search_terms
params[:search]
end
def label
t("admin.shared.user_search.placeholder")
end
end

View File

@@ -1 +1 @@
<%= render Admin::SearchComponent.new(url: url) %>
<%= render Admin::SearchComponent.new(url: url, label: t("admin.shared.user_search.placeholder")) %>