Make target a keyword argument for user_screen_name helper

Co-authored-by: nilsding <nilsding@nilsding.org>
This commit is contained in:
Karina Kwiatek 2023-05-09 23:20:36 +02:00
parent 46c2412ad8
commit 6643a4763f

View file

@ -12,7 +12,7 @@ module UserHelper
if url
return user_path(user) if link_only
return profile_link(user, "_top")
return profile_link(user, target: "_top")
end
user.profile.safe_name.strip
end
@ -23,7 +23,7 @@ module UserHelper
private
def profile_link(user, target = nil)
def profile_link(user, target: nil)
link_to(user.profile.safe_name, user_path(user), class: ("user--banned" if user.banned?).to_s, target:)
end