app/controllers/submissions_controller.rb
def newest_submissions
    @room = Room.find(params[:room_id])
    @beyond_id = params[:beyond_id]
    result = []
    @room.submissions.where("submissions.id > #{@beyond_id}").each do |s|
      sub = {
        id:  s.id,
        url: s.image.url(:medium),
        thumb: s.image.url(:thumb),
        show: s.show,
        star: s.starred,
        flag: s.flagged,
        rating: s.rating,
        participant_id: s.participant_id
      }
      result << sub
    end
    render :json => result
  end
# returns a json of the newest submissions whose id is greater than
# the specified id
returns a json of the newest submissions whose id is greater than
the specified id
returns a json of the newest submissions whose id is greater than the specified id
def newest_submissions
    @room = Room.find(params[:room_id])
    @beyond_id = params[:beyond_id]
    result = []
    @room.submissions.where("submissions.id > #{@beyond_id}").each do |s|
      sub = {
        id:  s.id,
        url: s.image.url(:medium),
        thumb: s.image.url(:thumb),
        show: s.show,
        star: s.starred,
        flag: s.flagged,
        rating: s.rating,
        participant_id: s.participant_id
      }
      result << sub
    end
    render :json => result
  end
def newest_submissions @room = Room . find ( params [ :room_id ] ) @beyond_id = params [ :beyond_id ] result = [ ] @room . submissions . where ( "submissions.id > #{@beyond_id}" ) . each do | s | sub = { id : s . id , url : s . image . url ( :medium ) , thumb : s . image . url ( :thumb ) , show : s . show , star : s . starred , flag : s . flagged , rating : s . rating , participant_id : s . participant_id } result << sub end render :json => result end
returns a json of the newest submissions whose id is greater than
the specified id
returns a json of the newest submissions whose id is greater than the specified id