Skip to content

Commit

Permalink
Fix nav
Browse files Browse the repository at this point in the history
Resolves #44
  • Loading branch information
pikesley committed Jan 30, 2016
1 parent 6c9e14a commit a43444c
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 14 deletions.
10 changes: 10 additions & 0 deletions app/helpers/application_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,14 @@ def date_sift measurements

h
end

def models
[
GlucoseMeasurement,
CarbohydrateIntake,
MedicationEvent,
PhysicalExercise
]
end

end
10 changes: 4 additions & 6 deletions app/views/shared/_nav.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,10 @@
<!-- Collect the nav links, forms, and other content for toggling -->
<div class='collapse navbar-collapse' id='navbar-collapse'>
<ul class='nav navbar-nav' role='tablist'>
<% if @models %>
<% @models.each do |model| %>
<li>
<%= link_to model.short_name, send("#{model.name.underscore}s_path") %>
</li>
<% end %>
<% models.each do |model| %>
<li>
<%= link_to model.short_name, send("#{model.name.underscore}s_path") %>
</li>
<% end %>
</ul>
<p class="navbar-text navbar-right">
Expand Down
9 changes: 1 addition & 8 deletions app/views/welcome/index.html.erb
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
<% @models = [
GlucoseMeasurement,
CarbohydrateIntake,
MedicationEvent,
PhysicalExercise
] %>
<% @models.each do |model| %>
<% models.each do |model| %>
<%= link_to model.short_name, send("#{model.name.underscore}s_path"), class: 'btn btn-success' %>
<% end %>

0 comments on commit a43444c

Please sign in to comment.