I need to create a new entity B whenever I create an entity A. To do this I tried adding a call to B.create inside the A.create method in a_controller. This however gives an error:
Missing template a/create
So my question is: how do I create an entity B from the A.create controller?
something like this?
but if your objects are ‘related’, i.e. has_many or belongs_to then you might want something like
and third option is to use accepts_nested_attributes_for – read more here: http://currentricity.wordpress.com/2011/09/04/the-definitive-guide-to-accepts_nested_attributes_for-a-model-in-rails-3/