diff --git a/app/controllers/search_controller.rb b/app/controllers/search_controller.rb index b6b90c734..b93644f02 100644 --- a/app/controllers/search_controller.rb +++ b/app/controllers/search_controller.rb @@ -59,7 +59,8 @@ def allowed_model(model_param) "workshop" => Workshop, "organization" => Organization, "event" => Event, - "event_registration" => EventRegistration + "event_registration" => EventRegistration, + "resource" => Resource }[model_param] end diff --git a/app/models/resource.rb b/app/models/resource.rb index a840d83ce..540566486 100644 --- a/app/models/resource.rb +++ b/app/models/resource.rb @@ -1,5 +1,6 @@ class Resource < ApplicationRecord - include AuthorCreditable, Featureable, Publishable, TagFilterable, Trendable, WindowsTypeFilterable, RichTextSearchable + include AuthorCreditable, Featureable, Publishable, RemoteSearchable, TagFilterable, Trendable, WindowsTypeFilterable, RichTextSearchable + remote_searchable_by :title include Rails.application.routes.url_helpers include ActionText::Attachable include Mentionable diff --git a/app/policies/resource_policy.rb b/app/policies/resource_policy.rb index 2cbf485bd..185915611 100644 --- a/app/policies/resource_policy.rb +++ b/app/policies/resource_policy.rb @@ -13,6 +13,10 @@ def create? admin? end + def search? + authenticated? + end + def update? admin? end diff --git a/app/views/events/_registration_ticket_callout_resource_fields.html.erb b/app/views/events/_registration_ticket_callout_resource_fields.html.erb index 01fa46d94..b99aaac05 100644 --- a/app/views/events/_registration_ticket_callout_resource_fields.html.erb +++ b/app/views/events/_registration_ticket_callout_resource_fields.html.erb @@ -4,9 +4,18 @@ under the title on the resource's own page. %>