Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
任何人都知道在标识符中使用变量的语法是什么?IE:
for a in @issue.articles f.select "article#{a.page}", options_from_collection_for_select(@articles, 'id', 'name', @issue.article2) end
2in@issue.article2可以是for循环中的迭代器。
2
@issue.article2
for
干杯!
您的意思是动态方法名称。就是这样:
number = 2 @issue.send("article#{number}")
请参阅ruby 方法名称中的变量。