Last active
December 19, 2015 04:59
-
-
Save atomical/5901432 to your computer and use it in GitHub Desktop.
Revisions
-
atomical revised this gist
Jul 1, 2013 . 1 changed file with 5 additions and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -4,4 +4,8 @@ def active_for_controller controller_name def active_for_action action_name params[:action].to_s == action_name.to_s ? 'active' : '' end Usage: = link_to 'Some resource', resource_path, class: active_for_controller('resource') -
atomical renamed this gist
Jul 1, 2013 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
atomical created this gist
Jul 1, 2013 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,7 @@ def active_for_controller controller_name params[:controller].to_s == controller_name.to_s ? 'active' : '' end def active_for_action action_name params[:action].to_s == action_name.to_s ? 'active' : '' end