when you call Model.create, it initiates and saves it. You probably want
Model.new though, you really don't even want that if you're looking to do it
as a transition...
I used this code in a friendship type lifecycle, to be used in the current
context of a user:
<def tag="invite-button">
<% target = this %>
<do with="&Friendship.new">
<form controller="friendships" lifecycle="invite" unless="&target ==
current_user or current_user.friends('all').include?(target)">
<input type="hidden" name="friendship[invitee_id]" value="#{target.id}"
/>
<submit label="Request as Friend" />
</form>
</do>
</def>
Honestly not very good code as I really should just check permissions like
this in the lifecycle itself. I can't remember why but I had trouble
getting that way to work and this got the job done.
--
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.