Skip to content

Commit

Permalink
Indicate the active page title
Browse files Browse the repository at this point in the history
  • Loading branch information
ahangarha committed Nov 3, 2023
1 parent 1c237e7 commit 78fd9b3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions app/assets/stylesheets/welcome.scss
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ nav {
&:hover {
background-color: #edd;
}

&.active {
background-color: #edd;
}
}
}

4 changes: 2 additions & 2 deletions app/views/welcome/_nav.html.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<nav >
<%= link_to "Client Side Rendering", '/welcome/csr' %>
<%= link_to "Server Side Rendering", '/welcome/ssr' %>
<%= link_to "Client Side Rendering", '/welcome/csr', class: current_page?(welcome_csr_path) ? "active" : "" %>
<%= link_to "Server Side Rendering", '/welcome/ssr', class: current_page?(welcome_ssr_path) ? "active" : "" %>
</nav>

0 comments on commit 78fd9b3

Please sign in to comment.