use rails action_name & controller_name methods (#2666)

Co-authored-by: Ahmad Farhat <ahmad.af.farhat@gmail.com>
This commit is contained in:
Mohamad Abras
2021-04-17 21:35:52 +03:00
committed by GitHub
parent 5eea14a780
commit 81c9e7db10
5 changed files with 14 additions and 21 deletions

View File

@ -32,7 +32,7 @@
<% end %>
<% if current_user.role.get_permission("can_create_rooms") && !current_user.has_role?(:super_admin) && !hide_recording_tables %>
<% all_rec_page = params[:controller] == "users" && params[:action] == "recordings" ? "active" : "" %>
<% all_rec_page = controller_name == "users" && action_name == "recordings" ? "active" : "" %>
<%= link_to get_user_recordings_path(current_user), class: "px-3 mx-1 mt-1 header-nav #{all_rec_page}" do %>
<i class="fas fa-video pr-1"></i><span class="d-none d-sm-inline-block"><%= t("header.all_recordings") %></span>
<% end %>