Last active
December 17, 2015 05:58
-
-
Save asvechkar/5561497 to your computer and use it in GitHub Desktop.
Функция возвращает текущий элемент меню
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module ApplicationHelper | |
def link_to_current_page(name, path) | |
css_class = current_page?(path) ? 'class="active"' : '' | |
raw("<li #{css_class}>#{link_to name, path}</li>") | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment