Ich versuche, eine Rails-App mit Bootstrap zu stylen navigation tabs. Meine App ist so, dass ich nicht nur Seiten, sondern auch Unterseiten habe. Registerkarten repräsentieren Superseiten (sozusagen). Siehe unten:Bootstrap-Navigationsregisterkarten mit Schienen Unterseiten
<ul class="nav nav-tabs">
<li class="tab"><%= link_to "Contacts", edit_entities_path(@company) %></li>
<% for stock in @company.stocks.each %>
<% if stock.id %>
<li class="tab"><%= link_to "#{stock.security_series} #{stock.security_class} Stock", stock_stockholders_path(stock) %></li>
<% end %>
<% end %>
<% for option in @company.options.each %>
<% if option.id %>
<li class="tab"><%= link_to "#{option.security_series} #{option.security_class} Options", option_optionees_path(option) %></li>
<% end %>
<% end %>
<% for warrant in @company.warrants.each %>
<% if warrant.id %>
<li class="tab"><%= link_to "#{warrant.security_series} #{warrant.security_class} Warrant", warrant_warrantees_path(warrant) %></li>
<% end %>
<% end %>
<% for note in @company.convertible_notes.each %>
<% if note.id %>
<li class="tab"><%= link_to "#{note.security_series} #{note.security_class} Note", convertible_note_convertible_notees_path(note) %></li>
<% end %>
<% end %>
</ul>
Tabs bezeichnen eine beliebige Anzahl von Aktien, convertible_notes, Optionen und Optionsscheine
resources :stocks do
resources :stockholders
end
resources :convertible_notes do
resources :convertible_notees
end
resources :options do
resources :optionees
end
resources :warrants do
resources :warrantees
end
Weiteren Kontext eines Company
has_many :stocks :convertible_notes :options :warrants
Was ich nach: Ich möchte die aktive Klasse anwenden, wenn ich auf einer bestimmten Seite ODER auf meiner Unterseite bin. Also, ich will nicht nur die Aktie mit der ID 1-Registerkarte .active
wenn ich drauf bin, sondern auch, wenn ich auf der Aktieninhaber-Unterseite bin.
Was könnte der beste Weg sein, dies zu erreichen? Danke im Voraus.