On Jun 27, 2011, at 9:51 AM, ylluminate wrote: > Unfortunately no, it appears that this is not the solution in this > scenario. > > Let me give the real code here: > > #### MODELS #### > class PropertyType < ActiveRecord::Base > hobo_model # Don't put anything above this > fields do > # FIELDS > end > has_many :properties > children :properties > end > > class Property < ActiveRecord::Base > hobo_model # Don't put anything above this > fields do > # FIELDS > end > belongs_to :property_type # <------------ child of PropertyType > belongs_to :user > has_many :property_images, :dependent => :destroy > belongs_to :city > belongs_to :county > belongs_to :township > has_many :rooms > children :property_images, :rooms > end > #### END MODELS #### > > So, if I try this in either of the controllers it simply will not > produce any visible results on the properties new page.
A couple things: - you definitely want to check out select-one-or-new; this is *exactly* the use case that was designed for. - auto_actions_for isn't going to do anything relevant here, especially for the new page; it's hard to make a request to /properties/:property_id/property_types/new when :property_id isn't set yet. The typical usage of auto_actions_for in your scenario would be a somewhat different flow; you'd locate (or create new) a particular PropertyType and then hit a route like /property_types/:property_type_id/properties/new to create a new record with that type. --Matt Jones -- You received this message because you are subscribed to the Google Groups "Hobo Users" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/hobousers?hl=en.
