Skip to content

Commit

Permalink
Nav
Browse files Browse the repository at this point in the history
  • Loading branch information
pikesley committed Feb 21, 2016
1 parent 2cbfafd commit 4459df5
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
7 changes: 7 additions & 0 deletions app/helpers/application_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,13 @@ def models
PhysicalExercise
]
end

def longterms
[
GlycatedHaemoglobin,
BloodPressure
]
end

def class_name instance
begin
Expand Down
15 changes: 15 additions & 0 deletions app/views/shared/_nav.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,21 @@
<%= link_to model.short_name, send("#{model.name.underscore}s_path") %>
</li>
<% end %>

<li role="presentation" class="dropdown">
<a class="dropdown-toggle" data-toggle="dropdown" href="#" role="button" aria-haspopup="true" aria-expanded="false">
Others <i class='fa fa-arrow-down'></i>
</a>
<ul class="dropdown-menu">
<% longterms.each do |longterm| %>
<li>
<%= link_to longterm.short_name, send("#{longterm.name.underscore}s_path") %>
</li>
<% end %>
</ul>
</li>


</ul>
<p class="navbar-text navbar-right">
<% if signed_in? %>
Expand Down

0 comments on commit 4459df5

Please sign in to comment.