Skip to content

Instantly share code, notes, and snippets.

@paulmars
Created January 26, 2016 20:05
Show Gist options
  • Select an option

  • Save paulmars/156fe405f51e41f819d7 to your computer and use it in GitHub Desktop.

Select an option

Save paulmars/156fe405f51e41f819d7 to your computer and use it in GitHub Desktop.
active tabs in rails
def cp(path)
"active" if current_page?(path)
end
def tab_link_to(title, uri)
content_tag :li, class: cp(uri), role: :presentation do
link_to title, uri
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment