我試圖在頁面中嵌入視頻。我嘗試兩種不同的方式,但沒有運氣在導軌中嵌入YouTube視頻
show.html.erb
<p id="notice"><%= notice %></p>
<p>
<b>Name:</b>
<%= @video.name %>
</p>
<p>
<b>Url:</b>
<%= @video.url %>
</p>
<p>
<% #video_tag(@video.url , :size => "560x315", :controls => true, :autobuffer => true) %>
<%= youtube_video @video.url%>
</p>
<%= link_to 'Edit', edit_video_path(@video) %> |
<%= link_to 'Back', videos_path %>
視頻不顯示同樣沒有它下面的鏈接。
任何提示將不勝感激。謝謝
這是調試結果
::的ActionView在MissingTemplate#視頻顯示
顯示 /用戶/ atbyrd /文件/網站/城市/應用/視圖/視頻/顯示。 html.erb 其中行#15提出:
缺少部分共享/視頻與{:處理器=> [:ERB,:助洗劑, :咖啡]:格式=> [:HTML]:場所=> [:en,:en]}。搜索範圍:* 「/ Users/atbyrd/Documents/sites/city/app/views」* 「/Users/atbyrd/.rvm/gems/ruby-1.9.2-p290/gems/devise-1.5.1/應用程序/意見」
提取的源(圍繞線#15):
12:13:
14:<%#video_tag(@ video.url,:大小=> 「560x315」, :對照= > true,:autobuffer => true)%> 15:<%= youtube_video @ video.url%> 16:
17:18:<%= link_to'編輯', edit_video_path(@video)%> |Rails.root:/ Users/atbyrd/Documents/sites/city應用程序跟蹤| 框架跟蹤|全面跟蹤
應用程序/傭工/ application_helper.rb:4:
youtube_video' app/views/videos/show.html.erb:15:in
_app_views_videos_show_html_erb__1532956397246631491_70281299458880' 應用程序/控制器/ videos_controller.rb:18:在'秀」
你能提供你的'@ video.url'和呈現的HTML?我認爲第一種方式應該可行。 – miaout17