OK, I have installed the Ancestry gem, migrated the db fields, and am
working on my very first recipe to contribute to the cookbook.
However, I've hit a roadblock and need some help...

I have a model that I'm going to use for a menu system, and the model
is called MenuEntry. It just has a name :string and the
ancestry :string fields, plus an associated belongs_to :post
relationship. I think I'd like to set it up to where you simply pick a
parent menu entry in the new/edit forms. If I understand the ancestry
gem correctly I'll just need to provide the user with a drop down list
of all the available menu_entries and then pass the selected one to
the new method of the controller when creating this one.

1) How do I create a drop down of all the menu entries? It looks to me
like <select-one> would be the best way to go, but is it only usable
on models that are set up to have a belongs_to relationship, or can I
override that with something like <select-one
entries="#{MenuEntry.all}">... or something like that?

2) Once I get that, can I pass the selected menu_entry to the new
controller method and do what I need with it? I think the code I'd
need in a non-hobo app would be something like this: @menu_entry =
MenuEntry.new(:parent_id => params[:parent_id]) but I was wondering if
I could pass those parameters into hobo_new like this:
hobo_new :parent_id => params[:parent_id]

I think the :parent_id is set up when you declare the model with
has_ancestry, so I assume that means it is "hidden" to hobo, and all
the information is stored in that string field anyway. Any ideas on
where I can look?

Thanks,
Joey

-- 
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