Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactoring profile.html.erb code pt.1 #4355

Closed
wants to merge 9 commits into from
3 changes: 3 additions & 0 deletions app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ class ApplicationController < ActionController::Base
before_action :set_locale

private
def current_profile_user
return @current_user && @profile_user == @current_user
end

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove these 2 lines and test would pass, as currently missing end would be generating error.

# eventually videos could be a power tag
def set_sidebar(type = :generic, data = :all, args = {})
Expand Down
2 changes: 1 addition & 1 deletion app/views/users/profile.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@
<% end %>
</p>

<% if @profile_user && current_user && @profile_user == current_user %>
<% if current_profile_user %>
<button id="btn-token" class="btn btn-default btn-block">My Access Token</button>
<% end %>

Expand Down