Create traces feed resource
This commit is contained in:
parent
2626c763b5
commit
f2a0f53cf5
10 changed files with 149 additions and 130 deletions
20
app/controllers/traces/feeds_controller.rb
Normal file
20
app/controllers/traces/feeds_controller.rb
Normal file
|
@ -0,0 +1,20 @@
|
|||
module Traces
|
||||
class FeedsController < ApplicationController
|
||||
before_action :authorize_web
|
||||
before_action :set_locale
|
||||
before_action :check_database_readable
|
||||
|
||||
authorize_resource :class => Trace
|
||||
|
||||
def show
|
||||
@traces = Trace.visible_to_all.visible
|
||||
|
||||
@traces = @traces.joins(:user).where(:users => { :display_name => params[:display_name] }) if params[:display_name]
|
||||
|
||||
@traces = @traces.tagged(params[:tag]) if params[:tag]
|
||||
@traces = @traces.order("timestamp DESC")
|
||||
@traces = @traces.limit(20)
|
||||
@traces = @traces.includes(:user)
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue