Matt Jones wrote: > On Feb 19, 8:16�pm, John Merlino <li...@ruby-forum.com> wrote: >> in the studentfails table). >> def update_failing_student >> � @student = @student.find params[:id] >> � @student.build_student_fail params[:student][:student_fail_attribute] >> end > > You don't appear to be *saving* the result from > @student.build_student_fail. Either you're looking for > create_student_fail (which saves the record) or something like: > > def update_failing_student > @student = Student.find(params[:id]) > @student_fail = @student.build_student_fail(params[:student] > [:student_fail_attribute]) > if @student_fail.save > # save succeeded > else > # save failed - re-render form with errors > end > end > >> Even for this you have to put student_fail_attribute in the html. I'm >> hoping there's a way where you don't have to put anything in the html. > > Not sure what you're looking for here: it's going to be hard to get a > field from the user without asking for it... > > --Matt Jones
The form will be in the other application used as a front end, not in rails. So the user will put data in that form but I want it to update to another table, not the students table even though we capture the data in the students controller. -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.