Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions app/controllers/faq_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@ def destroy
private

def create_params
params.expect(faq: [Current.ability.permitted_attributes(:create, FAQ)])
params.expect(faq: Current.ability.permitted_attributes(:create, FAQ))
end

def update_params
params.expect(faq: [Current.ability.permitted_attributes(:update, @faq)])
params.expect(faq: Current.ability.permitted_attributes(:update, @faq))
end
end
2 changes: 1 addition & 1 deletion app/controllers/participants/waivers_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def require_safety_briefing

def participant_params
params.expect(
participant: [Current.ability.permitted_attributes(:update, @participant)]
participant: Current.ability.permitted_attributes(:update, @participant)
)
end
end
6 changes: 2 additions & 4 deletions app/controllers/participants_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ class ParticipantsController < ApplicationController
include PersonalPathable

before_action :require_authentication
before_action :load_participant, only: :show
load_and_authorize_resource

# Index method with manual pagination using page and size parameters
Expand Down Expand Up @@ -45,9 +46,6 @@ def lookup
end

def show
# load_resource doesn't work for the /profile URL that the waiver redirects
# to, so fallback @participant to the current user in that case
participant
end

def new
Expand Down Expand Up @@ -128,7 +126,7 @@ def create_params

def update_params
params.expect(
participant: [Current.ability.permitted_attributes(:update, @participant)]
participant: Current.ability.permitted_attributes(:update, @participant)
)
end

Expand Down
4 changes: 4 additions & 0 deletions app/helpers/participants/safety_briefings_helper.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# frozen_string_literal: true

module Participants::SafetyBriefingsHelper
def safety_video_id_json(video_id)
video_id.to_json.html_safe # rubocop:disable Rails/OutputSafety
end

def safety_video_duration(duration)
ActiveSupport::Duration.build(duration).inspect
end
Expand Down
8 changes: 4 additions & 4 deletions app/views/participants/safety_briefings/_video.html.erb
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
<% content_for :head do %>
<%= javascript_include_tag(
'custom/youtube-player-api.js',
'data-turbo-track': 'reload'
) %>
'custom/youtube-player-api.js',
'data-turbo-track': 'reload'
) %>

<script type="text/javascript">
function onYouTubePlayerAPIReady() {
const el = document.getElementById('safety-video');
player = new YT.Player("safety-video", {
height: "390",
width: "640",
videoId: el.dataset.videoId,
videoId: <%= safety_video_id_json(@safety_video_id) %>, <%# erblint:disable ErbSafety %>
playerVars: {
autoplay: 1,
controls: parseInt(el.dataset.controls),
Expand Down
Loading