docbrown/app/controllers/api/v0/videos_controller.rb
cyrillefr 4fd66372dc Enable Layout/AlignParameters (#2340)
Check if the parameters on a multi-line method call or definition are aligned.

Resolves: #2021
2019-04-08 18:47:34 -04:00

22 lines
638 B
Ruby

module Api
module V0
class VideosController < ApiController
caches_action :index,
cache_path: proc { |c| c.params.permit! },
expires_in: 10.minutes
respond_to :json
before_action :cors_preflight_check
after_action :cors_set_access_control_headers
def index
@page = params[:page]
@video_articles = Article.where.not(video: [nil, ""], video_thumbnail_url: [nil, ""]).
where("score > ?", -4).
where(published: true).
order("hotness_score DESC").
page(params[:page].to_i).per(24)
end
end
end
end