-
- -
- <%= link_to cities_path do %>
-
- Home
- <% end %>
-
- <% if @current_region %>
- - <%= @current_region.name %>
+
+
+
+
+
+
+
+ -
+ <%= link_to cities_path,
+ class: "#{@current_region ? '' : 'active'}" do %>
+ All Regions
<% end %>
- <% if @current_country %>
-
- <%= @current_country.name %>
+
+
+ <% @regions.each do |region| %>
+ -
+ <%= link_to region.name,
+ cities_path(region: region.slug),
+ class: "#{@current_region == region ? 'active' : ''}" %>
+
+ <% end %>
+
+
+
+
+ <% if @current_region %>
+
+
+
+ -
+ <%= link_to "All in #{@current_region.name}",
+ cities_path(region: @current_region.slug),
+ class: "#{@current_country ? '' : 'active'}" %>
+
+
+ <% @current_region.countries.order(:name).each do |country| %>
+ -
+ <%= link_to country.name,
+ cities_path(region: @current_region.slug, country: country.slug),
+ class: "#{@current_country == country ? 'active' : ''}" %>
+
<% end %>
-
- <% end %>
+ <% end %>
+
+
+
+
+ <%= @cities.count %> <%= 'city'.pluralize(@cities.count) %>
+ <% if @current_country %>
+ in <%= @current_country.name %>
+ <% elsif @current_region %>
+ in <%= @current_region.name %>
+ <% end %>
+