Guest User

Untitled

a guest
Feb 20th, 2018
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. def link_to_with_current(name, options = {}, html_options = {}, *parameters_for_method_reference)
  2. if (current_page?(options))
  3. if(html_options[:class] && html_options[:class].length > 0)
  4. html_options[:class] += " current"
  5. else
  6. html_options[:class] = "current"
  7. end
  8. end
  9. link_to(name, options, html_options, *parameters_for_method_reference)
  10. end
  11.  
  12. # Make sure to use objects_path or new_object_path if you are running edge rails and using restful named routes...
Add Comment
Please, Sign In to add comment