Support back link on non resource links

This commit is contained in:
2019-10-14 13:52:44 -05:00
parent 4611432ea7
commit 310a0e1187
+15 -1
View File
@@ -109,7 +109,21 @@ module Dunlop
end end
def page_title_for_string(args) def page_title_for_string(args)
args.first title = args.first
options = args.last.is_a?(Hash) ? args.last : {}
if back_options = options[:back]
url =
case back_options
when Array then polymorphic_path(back_options)
when true then :back
else back_options
end
if url
back_link = link_to content_tag(:i, nil, class: 'left arrow icon'), url, class: 'title-back-link'
title = [back_link, title].join.html_safe
end
end
title
end end
def page_title_for_resource(args) def page_title_for_resource(args)