Displaying 1 result from an estimated 1 matches for "find_all_by_question_id".
2006 Jun 04
4
Multiple checkboxes
...options %>
<input type="checkbox" name="option[]" value="<%=option.id%>"><%=
option.option_text %></br>
<% end %>
</br>
<%= submit_tag%>
<%= end_form_tag%>
Controller:
def save_question
@options = Option.find_all_by_question_id(session[:question_id])
response = ""
for option in @options do
if params[:option][option.id]=="1"
response << "1"
else
response << "0"
end
end
end
--
Posted via http://www.ruby-forum.com/.