Sha256: 01e0676158d6ab0d6d626f6e4c46a0c71a6161e3f8cc935fb0dcc553d4e9c35b

Contents?: true

Size: 635 Bytes

Versions: 3

Compression:

Stored size: 635 Bytes

Contents

module Resizing::Rails
  module VideosHelper
    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

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

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

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
resizing-rails-0.4.1 app/helpers/resizing/rails/videos_helper.rb
resizing-rails-0.4.0 app/helpers/resizing/rails/videos_helper.rb
resizing-rails-0.3.0 app/helpers/resizing/rails/videos_helper.rb