1
我與軌道3個工作,我有以下型號Rails Var轉儲在頁面底部?
我控制器
class ContactController < ApplicationController
def index
@surveys = Survey.active
end
end
和我的觀點
<%= @surveys.each do |p| %>
<li><%=p.id %>-<%=p.name %></li>
<%end%>
我預期的結果是,它爲每個通過調查變量輸出身份證和姓名。但它也會將頁面底部的變量轉儲出去。
1-name
[#<Survey id: 1, name: "name", is_active: true, user_id: nil, open_script: "Opening Script", voicemail_script: "Voice Mail Script", closing_script: "Closing Script", email_script: "Email Script", created_at: "2012-12-19 15:17:36", updated_at: "2012-12-20 03:46:35">]
哇,我覺得愚蠢,當然。謝謝! – gsueagle2008