Displaying 2 results from an estimated 2 matches for "option_text".
Did you mean:
action_text
2006 Jun 04
4
Multiple checkboxes
...View:
<%= form_tag :action=>''save_question''%>
<h3><%= @question.title %></h3>
</br>
<% for option in @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"...
2006 Feb 16
9
rake migrate HANGS
...umn ''user_id'', :integer
table.column ''start_time'', :datetime
table.column ''end_time'', :datetime
end
create_table poll_options do |table|
table.column ''poll_id'', :integer
table.column ''option_text'', :string
table.column ''option_order'', :integer
end
execute ''ALTER TABLE poll_options ADD CONSTRAINT fk_polls FOREIGN
KEY ( poll_id ) REFERENCES polls( id ) ''
end
def self.down
drop_table :polls
drop_table :poll_options
en...