나는 내 레일 앱에서 ruby-1.8.7 및 rails 2.3.5를 사용하고 있습니다. 사용자가 youtube_it 보석을 사용중인 YouTube에 자신의 동영상을 업로드 할 수 있도록하는 요구 사항이 있습니다. 하지만 내가 문서화를 제대로 따르고 있는지 확실하지 않습니다.youtube_it gem in rails app
여기 내 컨트롤러 코드입니다 :
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")
여기에 도움이 필요합니다.