Add app/controllers/users_controller.rb
This commit is contained in:
parent
ad5a01139e
commit
336d9b7874
1 changed files with 27 additions and 0 deletions
27
app/controllers/users_controller.rb
Normal file
27
app/controllers/users_controller.rb
Normal 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
|
||||
Loading…
Reference in a new issue