I complete forgot about the create method. it works like a charm..! :D

I'ts a follow up on my provious post
http://groups.google.com/group/hobousers/browse_thread/thread/ba5d5563caea94cc
I've made a select-one form for each transition and rendered it at the
bottom of each list of transition element like this:

                <ul id="list-volunteers" class="collection event-attendees ui-
sortable">
                        <repeat with="&this.event_attendees.volunteer"><li 
id="event-
attendee-#{this.id}" class="sortable"><card /></li></repeat>
                        <li class="controls add-new">
                                <form:event_attendees.new 
lifecycle="add_volunteer" reset-form
refocus-form>
                                        Add volunteer: <select-one:user
options="&User.activated.without_event(this_parent.first.event.id)" />
                                        <submit label="add"/>
                                </form>
                        </li>
                </ul>

and here's the create method
    create :add_volunteer, :available_to => "User", :params =>
[:event, :user], :become => :volunteer

really nice functionality..!

i really feel i'm getting somewhere with hobo now, and it get's cooler
for every new thing i learn..! :D


On Feb 5, 9:55 pm, Bryan Larsen <[email protected]> wrote:
> Are you instantiating using "User.new" or are you using a creator
> function?  I recommend creator functions in your case.
>
> The "right" way to have more than one initial state is to have several
> creator functions.  Or you can have a single creator function where the
> :become is set to a proc rather than a symbol.
>
> More info 
> here:http://cookbook.hobocentral.net/manual/lifecycles#defining_creators
>
> Bryan
>
> Mikkel WF wrote:
> > Is there any way to manually override the default lifecycle state when
> > creating an item..?

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