app/helpers/spotlight/application_helper.rb in blacklight-spotlight-0.0.2 vs app/helpers/spotlight/application_helper.rb in blacklight-spotlight-0.0.3
- old
+ new
@@ -1,7 +1,9 @@
module Spotlight
module ApplicationHelper
+ include CrudLinkHelpers
+ include AdminTitleHelper
# Can search for named routes directly in the main app, omitting
# the "main_app." prefix
def method_missing method, *args, &block
if main_app_url_helper?(method)
@@ -35,10 +37,19 @@
def curation_mode?
params[:action] == "edit"
end
+ def url_to_tag_facet tag
+ if current_exhibit
+ search_action_url(add_facet_params(Spotlight::SolrDocument.solr_field_for_tagger(current_exhibit), tag, {}))
+ else
+ search_action_url(q: tag)
+ end
+ end
+
private
+
def main_app_url_helper?(method)
(method.to_s.end_with?('_path') or method.to_s.end_with?('_url')) and
main_app.respond_to?(method)
end