diff options
| author | mo khan <mo@mokhan.ca> | 2017-02-25 20:35:24 -0700 |
|---|---|---|
| committer | mo khan <mo@mokhan.ca> | 2017-02-25 20:35:24 -0700 |
| commit | 74d6b83b557a9e7ec5bfbfccdedcde3395dc4687 (patch) | |
| tree | 7731f413c99457f9e50cd7bcea2183877389b829 /app | |
| parent | a953f1acc648695cf6ab120663c068fcac47709b (diff) | |
find by username.
Diffstat (limited to 'app')
| -rw-r--r-- | app/controllers/charts_controller.rb | 2 | ||||
| -rw-r--r-- | app/views/profiles/show.html.erb | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/app/controllers/charts_controller.rb b/app/controllers/charts_controller.rb index 9acf184..d97b4fb 100644 --- a/app/controllers/charts_controller.rb +++ b/app/controllers/charts_controller.rb @@ -23,6 +23,6 @@ class ChartsController < ApplicationController end def user - User.find_by(id: params[:user_id]) || current_user + User.find_by(username: params[:username]) || current_user end end diff --git a/app/views/profiles/show.html.erb b/app/views/profiles/show.html.erb index c810b2d..c11acc9 100644 --- a/app/views/profiles/show.html.erb +++ b/app/views/profiles/show.html.erb @@ -26,7 +26,7 @@ <% personal_record = history.personal_record %> <div class="level-item has-text-centered"> <div> - <p class="heading"><%= link_to history.exercise.name, charts_path(exercise: history.exercise, user_id: @user), remote: true %></p> + <p class="heading"><%= link_to history.exercise.name, charts_path(exercise: history.exercise, username: @user), remote: true %></p> <p class="title"><%= personal_record ? "#{personal_record} lbs" : t('.not_available') %></p> </div> </div> |
