2009-08-03 23 views
0

我有這樣的觀點存在一個,我如何能選擇的值進行比較,在軌

<% count = 1 %> 
<% for voting in @voting %> 
    <% if voting.question_id.eql?(count) %> 
     <%= radio_button(count, voting.vote_count, :radio_id => voting.nominees ) %> 
     <%= voting.nominees %> 
    <% end %> 

    <% if voting.nominees.eql?(radio_id) %> 
     <% voting.update_attribute('vote_count', voting.vote_count+1) %> 
    <% end %> 
    <% count += 1 %> 
<% end %> 

我如何能與現有的一個選擇的被提名人進行比較。

有這方面的幫助將是非常有用的...

+2

抱歉,不知道代碼應該做什麼。是在db中選擇的還是什麼? – Beffa 2009-08-03 15:46:15

回答