I have the following routes
resources :tracking_categories do
resources :trackings
end
I have the following view and I'd like to highlight the button if anywhere inside the /tracking_categories
path, ex: http://localhost:3000/tracking_categories/6/trackings/new
. I tried current_page?
%li{class: current_page?(controller: 'tracking_categories') ? 'active' : false}
=link_to 'Track My Progress', new_tracking_category_tracking_path(1)
I also tried
%li{class: current_page?(controller: 'trackings') ? 'active' : false}
I also tried #url
%li{class: url.index('tracking_categories') ? 'active' : false}
They all return false, except url
, which gives the error
wrong number of arguments (0 for 2)