Skip to content
This repository
Browse code

Make path_to_video in video_tag apply to each source

  • Loading branch information...
commit 3339293280c12b1335d193c7f49c3e6ea665e76d 1 parent b1f8ba1
Janko Marohnić authored
2  actionpack/lib/action_view/helpers/asset_tag_helper.rb
@@ -422,7 +422,7 @@ def video_tag(sources, options = {})
422 422
 
423 423
         if sources.is_a?(Array)
424 424
           content_tag("video", options) do
425  
-            sources.map { |source| tag("source", :src => source) }.join.html_safe
  425
+            sources.map { |source| tag("source", :src => path_to_video(source)) }.join.html_safe
426 426
           end
427 427
         else
428 428
           options[:src] = path_to_video(sources)
4  actionpack/test/template/asset_tag_helper_test.rb
@@ -201,8 +201,8 @@ def teardown
201 201
     %(video_tag("error.avi", "size" => "x")) => %(<video src="/videos/error.avi" />),
202 202
     %(video_tag("http://media.rubyonrails.org/video/rails_blog_2.mov")) => %(<video src="http://media.rubyonrails.org/video/rails_blog_2.mov" />),
203 203
     %(video_tag("//media.rubyonrails.org/video/rails_blog_2.mov")) => %(<video src="//media.rubyonrails.org/video/rails_blog_2.mov" />),
204  
-    %(video_tag(["multiple.ogg", "multiple.avi"])) => %(<video><source src="multiple.ogg" /><source src="multiple.avi" /></video>),
205  
-    %(video_tag(["multiple.ogg", "multiple.avi"], :size => "160x120", :controls => true)) => %(<video controls="controls" height="120" width="160"><source src="multiple.ogg" /><source src="multiple.avi" /></video>)
  204
+    %(video_tag(["multiple.ogg", "multiple.avi"])) => %(<video><source src="/videos/multiple.ogg" /><source src="/videos/multiple.avi" /></video>),
  205
+    %(video_tag(["multiple.ogg", "multiple.avi"], :size => "160x120", :controls => true)) => %(<video controls="controls" height="120" width="160"><source src="/videos/multiple.ogg" /><source src="/videos/multiple.avi" /></video>)
206 206
   }
207 207
 
208 208
  AudioPathToTag = {

0 notes on commit 3339293

Please sign in to comment.
Something went wrong with that request. Please try again.