嘿傢伙 我是新來的鐵軌。我做了這個小測試代碼的學習軌道幫手:我找不出幫手Rails
應用程序/傭工/ home_helper.rb
module HomeHelper
def show(var)
yield var
end
end
應用程序/視圖/家庭/ index.html.rb
<%= show('hello world')%>
當我導航到網址localhost:3000/home/index
我在HTML源代碼中沒有任何東西 我做錯了什麼?
感謝您的回答。我做錯了的部分是<%= show('hello world'){| v | print v}%>我不應該在這裏調用打印方法,因爲在erb中,<%= %>打印出瀏覽器中的值 – mko 2011-03-01 02:56:50