這裏是我的代碼:如何在輸入值中顯示文字#{@ foo.bar}?
- snippets = ['state.name', 'city.name']
- snippets.each do |s|
input type="text" value="#{ s }"
我需要它返回(字面#{ @foo.bar }
):
<input type="text" value="#{ @state.name }" >
<input type="text" value="#{ @city.name }" >
一切我試圖返回一個奇怪的錯誤。
完美!奇蹟般有效。謝謝。 –
可以是'\#'或單引號;兩者都沒有必要。 – echristopherson
@echristopherson你確定嗎?請重讀OP併發佈一個實例 – 2012-10-22 15:15:55