0

我对 Rails 很陌生,但是有一个不错的项目正在进行

我的模型中有以下内容:

def self.get_feeds

sponsorlinks = RssFeed.all

links = sponsorlinks.each do |sponsorlink|
  puts sponsorlink.rss_url
end

feed_urls = ["link1","link2"]
update_from_feeds(feed_urls)

结尾

“链接”按预期将我的 2 个链接输出到控制台,但是如何将我的两个链接放入 feed_urls = ["link1","link2"]

以预期的格式?

4

1 回答 1

0
sponsorlinks = RssFeed.all

links = []
sponsorlinks.each do |sponsorlink|
  links << sponsorlink.rss_url
end
update_from_feeds(links)
于 2013-01-25T05:49:25.240 回答