Add app/controllers/users_controller.rb

This commit is contained in:
agnes 2026-03-07 18:29:41 +00:00
parent ad5a01139e
commit 336d9b7874

View file

@ -0,0 +1,27 @@
#insert into users controller for feed, very much a wip
def feed
begin
#@user = User.find(params[:id])
@user = User.find_by!(login: params[:id])
@works = @user.works.visible_to_all.order('created_at DESC').limit(25)
rescue ActiveRecord::RecordNotFound
raise ActiveRecord::RecordNotFound, "Couldn't find user with id '#{params[:id]}' or no works found for them lol"
end
#@tag = @tag.merger if !@tag.canonical? && @tag.merger
# Temp for testing
# if %w(Fandom Character Relationship).include?(@tag.type.to_s) || @tag.name == 'F/F'
#$ if @tag.canonical?
# @works = @tag.filtered_works.visible_to_all.order('created_at DESC').limit(25)
# else
# @works = @tag.works.visible_to_all.order('created_at DESC').limit(25)
#end
# else
# redirect_to(tag_works_path(tag_id: @tag.to_param)) && return
#end
respond_to do |format|
format.atom
end
end