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.
識別子で変数を使用するための構文を知っている人はいますか? すなわち:
for a in @issue.articles f.select "article#{a.page}", options_from_collection_for_select(@articles, 'id', 'name', @issue.article2) end
inはループ内の反復子になる可能性があり2ます。@issue.article2for
2
@issue.article2
for
乾杯!
動的メソッド名を意味します。方法は次のとおりです。
number = 2 @issue.send("article#{number}")
ruby メソッド名の変数 を参照してください。