current_action and current_controller helpers
create this helper and uses link_unless_current_controller
1 def current_action?(options) 2 url_string = CGI.escapeHTML(url_for(options)) 3 params = ActionController::Routing::Routes.recognize_path(url_string, :method => :get) 4 params[:controller] == @controller.controller_name && params[:action] == @controller.action_name 5 end 6 7 def current_controller?(options) 8 url_string = CGI.escapeHTML(url_for(options)) 9 params = ActionController::Routing::Routes.recognize_path(url_string, :method => :get) 10 params[:controller] == @controller.controller_name 11 end