我正在使用ruby-trello gem,我在添加附件卡时遇到了一些困难。
卡创建没有问题。清单补充说,一切都很好。
当我尝试创建附件时…
你可以使用 add_attachment Card类中的方法,第一个参数是文件或URL(在您的情况下),第二个参数是附件的可选名称。
add_attachment
这是一个有效的例子:
require "trello" public_key = "x" member_token = "x" board_id = "x" Trello.configure do |config| config.developer_public_key = public_key config.member_token = member_token end board = Trello::Board.find(board_id) list = board.lists.first card = list.cards.first attachment = card.add_attachment("https://google.com", "Link to Google")