Skip to content

Instantly share code, notes, and snippets.

@asvechkar
Last active December 17, 2015 05:58
Show Gist options
  • Save asvechkar/5561497 to your computer and use it in GitHub Desktop.
Save asvechkar/5561497 to your computer and use it in GitHub Desktop.
Функция возвращает текущий элемент меню
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