Commit 72dcfcd

mo khan <mo@mokhan.ca>
2017-02-18 17:35:11
fix chart templates.
1 parent b863966
Changed files (3)
app
app/controllers/charts_controller.rb
@@ -2,7 +2,7 @@ class ChartsController < ApplicationController
   def index
     exercise = Exercise.find_by(id: params[:exercise])
     respond_to do |format|
-      format.html { @training_history = current_user.history_for(exercise) }
+      format.js { @training_history = current_user.history_for(exercise) }
       format.json { render json: recent_workouts(exercise).to_line_chart }
     end
   end
app/views/graphs/show.js.erb → app/views/charts/index.js.erb
File renamed without changes
app/views/workouts/index.html.erb
@@ -52,7 +52,7 @@
   <% if @exercise %>
     <div class="columns">
       <div class="column is-12">
-        <%= line_chart charts_path(filter_params_hash(exercise: @exercise.to_param)) %>
+        <%= line_chart charts_path(filter_params_hash) %>
       </div>
     </div>
   <% end %>