Form_for submit to a different table

Can anyone point me in the right direction… I have created a page
using a form_for which pulls from "question’ table. I would like to
submit answer data to “student_data” table. I can’t figure out how to
submit specific fields to the alternate table. f.submit uses the table
specified by form_for (SOrry if a basic question… I’ll do the
research if someone can just help me get started)

Thanks!
DC

DC,

Try this,
http://www.railsforum.com/viewtopic.php?id=717
Use form_tag instead form_for

Saravanan K
http://bit.ly/9NpP7e

Saravanan K. wrote in post #999660:

DC,

Try this,
http://www.railsforum.com/viewtopic.php?id=717
Use form_tag instead form_for

Saravanan K
http://bit.ly/9NpP7e

Achh… should have gone to school for this!

Can I embed the form_tag in a form_for?

<%= form_for @question do |f| %>

<%= @formatted_question[:question]%>

<%= submit_tag @formatted_question[:answer_a], :name =>"A" %>

???

<%= f.submit @formatted_question[:answer_b], :name =>"B" %>

<%= f.submit @formatted_question[:answer_c], :name =>"C" %>

<%= f.submit @formatted_question[:answer_d], :name =>"D" %>

<%= f.submit @formatted_question[:answer_e], :name =>"E" %>

I need to get @formatted_question[:answer_x] from Question table
and submit the answer to a user_data table. Obviously, f.submit submits
the data to the Question table.

Thanks in advance.

Dave

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs