我在我的rails應用程序中使用Skydrive gem。Skydrive重命名文件夾
重命名我寫
def renaming_folder
client = Skydrive::Client.new(@@access_token)
folder_id = params[:folder_id]
# (url, {:body => options})
# options = {name: "#{params[:rename_field]}"}
puts "-------------------..."
puts "#{params[:folder_id]}"
client.get_skydrive_object_by_id(folder_id)
# I believe issue comes from this line:
folderObject = client.update_skydrive_object("#{params[:folder_id]}", options={name: "#{params[:rename_field]}"})
redirect_to drive_show_path
end
但我正在逐漸http_error_400的文件夾:錯誤的請求錯誤。我越來越
{"utf8"=>"✓",
"authenticity_token"=>"BAYGFcb5/74c7RV5NH1u4DCAT1MqLvLCkp9F3Q/Fav+B2wdab4aE5LBJAVr90MMu0GbfFwHTuLyncFRWtGyYTA==",
"rename_field"=>"weqweqwe",
"folder_id"=>"folder.cecb8eb83d90dbeb.CECB8EB83D90DBEB!106",
"commit"=>"Rename Folder"}
在我的參數。
有些人可以幫忙嗎?尋找來自可信和/或官方消息來源的答案。
我可以在添加放入時獲得所有的值。
已更改skydrive_object = client.get_skydrive_object_by_id(folder_id)skydrive_object.update_skydrive_object(params [:folder_id],options = {name:params [:rename_field]}),但它給NoMethodError:未定義的方法'update_skydrive_object'爲#錯誤 –
Neha
還檢查了選項folderObject = client.update_skydrive_object(「#{params [:folder_id]}」,options = {})中的空白值,然後它給出Skydrive :: Error(http_error_400:Bad Request) – Neha
如果你有任何其他選項,請讓我知道。 – Neha