Search on the same URL by default

This commit is contained in:
Javi Martín
2020-12-03 17:43:14 +01:00
parent e33794e45e
commit cf510043a4
10 changed files with 14 additions and 33 deletions

View File

@@ -1,12 +1,16 @@
class Admin::SearchComponent < ApplicationComponent
attr_reader :url, :label, :form_options
attr_reader :label, :form_options
def initialize(url:, label:, **form_options)
@url = url
def initialize(label:, url: nil, **form_options)
@label = label
@url = url
@form_options = form_options
end
def url
@url || request.path
end
private
def search_terms