Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def link_to_with_current(name, options = {}, html_options = {}, *parameters_for_method_reference)
- if (current_page?(options))
- if(html_options[:class] && html_options[:class].length > 0)
- html_options[:class] += " current"
- else
- html_options[:class] = "current"
- end
- end
- link_to(name, options, html_options, *parameters_for_method_reference)
- end
- # 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