你可以使用
add_attachment
Card类中的方法,第一个参数是文件或URL(在您的情况下),第二个参数是附件的可选名称。
这是一个有效的例子:
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”)
</code>