Complex Forms Generating Error
Posted
by
user1648020
on Stack Overflow
See other posts from Stack Overflow
or by user1648020
Published on 2012-10-01T03:36:03Z
Indexed on
2012/10/01
3:37 UTC
Read the original article
Hit count: 100
ruby-on-rails
|controller
I am working on an application that allows students to create a catalog of courses they are taking for a semester. I have created models for user; course; subject and category. Users can have many courses. Each course can have many subjects and categories. The tables for courses, subjects and categories include the following:
Catalog: user_id; subject_id, category_id and course_id
Courses: user_id; coursedetail_id
Coursedetail: name; description
Subject: name; description
Category: name; description
The idea is that an Admin can create a list of courses; subjects and categories and that the user can select the courses they want to add to their catalog. I have seperated courses and coursedetails because I envision that the coursedetails will grow overtime and the courses table will allow me to join the user_id and cousres details to rreport on if necessary. I attempted to follow Ryan's railscast on Complex Forms thinking that that I should use a complex form and has many relationship to get things working -- but I get an error in the catalog controller - cannot locate catalog_id which I know is in the table. I am now not sure if complex forms is the way to go or I should be looking at another direction to get the appropriate form in place. Any assistance would be appreciated.
© Stack Overflow or respective owner