Support back link on non resource links
This commit is contained in:
@@ -109,7 +109,21 @@ module Dunlop
|
||||
end
|
||||
|
||||
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
|
||||
|
||||
def page_title_for_resource(args)
|
||||
|
||||
Reference in New Issue
Block a user