extending Hobo controller methods

1 view
Skip to first unread message

adamski

unread,
Nov 7, 2008, 7:19:20 AM11/7/08
to Hobo Users
I have a number of similar Models in my app, and I'd like to extend
hobo_create so that it can automagically create another model with
data from the form+current user. Is there a preffered way to do this
in Hobo so I don't have to copy across all the controllers?
Thx

Tom Locke

unread,
Nov 7, 2008, 7:44:44 AM11/7/08
to hobo...@googlegroups.com
This might be better done in the model - thin controller, fat model
remember.

You could use the before_create callback. The user doing the create is
available as acting_user

Tom

adamski

unread,
Nov 7, 2008, 9:49:04 AM11/7/08
to Hobo Users
excellent, I used after_create which also meant I could move the code
into an included module :-)
Reply all
Reply to author
Forward
0 new messages