hidden user_id field

15 views
Skip to first unread message

Jeremy

unread,
Jul 20, 2011, 11:13:52 AM7/20/11
to Hobo Users
I'm looking through the Agility tutorial (which has helped me quite a
bit!) but I'm stuck at a change I'm trying to do.

I've been successful in creating the auto complete form here:
http://cookbook.hobocentral.net/tutorials/agility#auto-completion-form
which works perfectly in my project. What I would really like to do is
change this from a text box that the user enters their name into a
hidden field containing the current user_id. This seemed like it would
be a simply task but I can't figure out how to do this!

Can anyone give me some guidance?

kevinpfromnm

unread,
Jul 20, 2011, 12:07:45 PM7/20/11
to hobo...@googlegroups.com
sounds like you want a user association to be an owner.  try adding :creator => true to the association and user_is? acting_user to the create permission.

Jeremy

unread,
Jul 20, 2011, 12:45:09 PM7/20/11
to Hobo Users
I'm confused as to which association would I add the :creator => :true
too. The :belongs_to => :user in the ProjectMembership?

kevinpfromnm

unread,
Jul 20, 2011, 1:15:45 PM7/20/11
to hobo...@googlegroups.com
yes

kevinpfromnm

unread,
Jul 20, 2011, 1:16:06 PM7/20/11
to hobo...@googlegroups.com
oh, you want :creator => true, not :creator => :true

Jeremy

unread,
Jul 20, 2011, 2:04:26 PM7/20/11
to Hobo Users
Ah that makes sense. I left off the user_is? acting_user step because
the users won't be creating their own Projects. They can now assign
any project to themselves just like we want. Thanks!
Reply all
Reply to author
Forward
0 new messages