Module: Resizing::Rails::VideosHelper

Defined in:
app/helpers/resizing/rails/videos_helper.rb

Instance Method Summary collapse

Instance Method Details

#resizing_prepare_video_url(*args) ⇒ Object



11
12
13
# File 'app/helpers/resizing/rails/videos_helper.rb', line 11

def resizing_prepare_video_url(*args)
  Resizing::Rails::Engine.routes.url_helpers.prepare_videos_url(*args)
end

#resizing_video_tag(resizing_rails_video) ⇒ Object



15
16
17
# File 'app/helpers/resizing/rails/videos_helper.rb', line 15

def resizing_video_tag resizing_rails_video
  raw "<div class='video' data-video-url=#{resizing_rails_video.data_self_url}></div>"
end

#video_file_field_tag(name, options = {}) ⇒ Object

Raises:

  • (ArgumentError)


3
4
5
6
7
8
9
# File 'app/helpers/resizing/rails/videos_helper.rb', line 3

def video_file_field_tag name, options = {}
  raise ArgumentError, "video_file_field_tag requires Hash as option arguments" unless options.is_a? Hash

  options = options.merge(only_path: true)
  args['data-video-prepare-url'] = prepare_video_url(options)
  file_field_tag name
end