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.
我正在尝试将两个变量与它们之间的空格相加:
errors = [[lot_count, '#{attribute}: #{error}' ]]
当我显示这个时,我看到:#{attribute}: #{error}
#{attribute}: #{error}
任何想法为什么它没有给我变量的值?
Ruby 中的单引号没有内插,而双引号是:
"#{attribute} #{error}"