Matt:  THANK YOU!  Tremendous.  I am curious, I am converting an app
that used to have the following scenario:

There were fields such as "Elementary School" and "Heating System"
where they were simply table attributes and not actual children to a
parent table.  The way it worked was that there was a special control
via javascript that was a textfield with a drop down.  This control
would query the db so as to pull all, for example, "Cooling System"
entries from all "Cooling System" attributes in the table to populate
the drop down and allow an autofill as the user typed of the correct
entry if one already existed.  The reason this is useful is that these
items could change pretty regularly.  A modern control that would
currently fit this bill is: http://coffeescripter.com/code/editable-select/
Is this currently possible with Hobo?

Additionally Matt, it seems that the "Hobo way" of adding images to
something is to add a record and then immediately offer back the show
page and then add images or other things with that.  Is there a way to
allow images and other such dynamic things (such as in this case I'm
also adding "Rooms" in a dynamic way) on the creation page?  I realize
it's a chicken and egg scenario where you don't have the parent record
yet to which to attach them, so I don't know if this has been
considered so as to make tmp records and then reassign them upon
parent record creation...?

Thanks again!


On Jun 28, 9:25 am, Matt Jones <[email protected]> wrote:
> 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.

Reply via email to