class WorksController < ApplicationController before_action :set_work, only: [:show] def index @works = Work.includes(:videos).recent end def show @videos = @work.videos.includes(:storage_location).recent @primary_video = @work.primary_video end private def set_work @work = Work.find(params[:id]) end end