diff --git a/helpers/custom_helpers.rb b/helpers/custom_helpers.rb index 4bfd29a..daf5730 100644 --- a/helpers/custom_helpers.rb +++ b/helpers/custom_helpers.rb @@ -84,7 +84,11 @@ def is_page_active(page) # # = link_to 'Home', '/', class: ( 'is-active' if is_parent_page_active('/') ) # - def is_parent_page_active(page) - current_page.url.match(page) + def is_parent_page_active(url, title) + if current_page.data.parent.present? + current_page.data.parent == title + else + current_page.url.match(url) + end end end