Much base work started
This commit is contained in:
18
app/controllers/works_controller.rb
Normal file
18
app/controllers/works_controller.rb
Normal file
@@ -0,0 +1,18 @@
|
||||
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
|
||||
Reference in New Issue
Block a user