We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 91bbf94 commit aa26c55Copy full SHA for aa26c55
1 file changed
app/controllers/names_controller.rb
@@ -60,7 +60,11 @@ def index(opts = {})
60
@draft ||= false
61
@sort ||= params[:sort] || 'date'
62
@status ||= params[:status] || 'public'
63
- @title ||= "#{@status.gsub(/^\S/, &:upcase)} Names"
+ @title ||= [
64
+ @status == 'all' ? nil : @status.gsub(/^\S/, &:upcase),
65
+ 'Names',
66
+ @user.present? ? "by #{@user.username}" : nil
67
+ ].compact.join('')
68
opts[:rank] = params[:rank] if params[:rank].present?
69
70
opts[:status] ||=
@@ -122,7 +126,6 @@ def user
122
126
if params[:user] && current_user&.admin?
123
127
@user = User.find_by(username: params[:user])
124
128
end
125
- @title = "Names by #{@user&.username}"
129
@status = 'all'
130
index(where: { created_by: @user })
131
render(:index)
0 commit comments