Created
January 26, 2016 20:05
-
-
Save paulmars/156fe405f51e41f819d7 to your computer and use it in GitHub Desktop.
active tabs in rails
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
| 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