我在rails應用中使用了ruby-1.8.7和rails 2.3.5。我有要求讓用戶將他們的視頻上傳到youtube,我正在使用youtube_it gem。但我不確定我是否正確地跟蹤文檔。在rails應用中使用youtube_it gem
這裏是我的控制器代碼:
class VideosController < ApplicationController
def upload
@upload_info = YouTubeIt::Client.new.upload_token(params, videos_url)
# params represent what values here, the doc says title, description but do i have to #build another form to get these values, i really need a working example.
end
,這裏是我的形式:
<% form_tag @upload_info[:url], :multipart => true do %>
<%= hidden_field_tag :token, @upload_info[:token] %>
<%= label_tag :file %>
<%= file_field_tag :file %>
<%= submit_tag "Upload video" %>
<% end %>
是我應該在哪裏我的其他問題,指定下面的語句將初始化一個新的客戶對我來說:
client = YouTubeIt::Client.new(:dev_key => "developer_key")
我需要一些幫助。