Module: Www::VideosHelper
- Defined in:
- app/helpers/www/videos_helper.rb
Instance Method Summary collapse
- #cf_thumbnail_url(cloudflare_uid) ⇒ Object
-
#video_by_slug(slug) ⇒ Object
Simple helper for single video lookup by slug - returns presenter object.
Instance Method Details
#cf_thumbnail_url(cloudflare_uid) ⇒ Object
2 3 4 |
# File 'app/helpers/www/videos_helper.rb', line 2 def cf_thumbnail_url(cloudflare_uid) "#{CF_STREAM_URL}/#{cloudflare_uid}/thumbnails/thumbnail.jpg" end |
#video_by_slug(slug) ⇒ Object
Simple helper for single video lookup by slug - returns presenter object
7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'app/helpers/www/videos_helper.rb', line 7 def video_by_slug(slug) video = Video.friendly.find(slug) if video present(video, Www::VideoPresenter) else ErrorReporting.error('Video not found', slug: slug) if Rails.env.production? nil end rescue ActiveRecord::RecordNotFound ErrorReporting.error('Video not found', slug: slug) if Rails.env.production? nil end |