I have a Project object whose only parameter(besides :id) is :project_name.
The child of that object is ProjectDescription object whose parameters are :project_id and :description. How to code a form wich creates a project with corresponding description without Rails giving out any errors?
I have a Project object whose only parameter(besides :id) is :project_name. The child of
Share
As Castilho commented, it sounds like you could refactor your database schema and not have to worry about this, but…
What you’re looking for is called a nested attributes form:
http://api.rubyonrails.org/classes/ActiveRecord/NestedAttributes/ClassMethods.html
Ryan Bates did a great screencast on this topic:
http://railscasts.com/episodes/196-nested-model-form-part-1