Thanks Matt, that actually helps a lot ! One thing though, I no longer have the "New Task" link present on my tasks tab in the application, whether I'm the administrator or another user, and I get a stack trace when trying to access the tasks tab when I am the guest user. When I comment out the lines added, the link comes back ...
This was all pretty clear cut when using authlogic, and I'm sure it is with hobo as well. Perhaps this is where the permissions thing comes in? I'm a total newb to Hobo and fairly new to rails (flex/php background) so if these questions and their answers seem obvious please excuse my ignorance ... thanks again --- this is really great stuff !! --jeremy On Apr 7, 9:47 am, Matt Jones <[email protected]> wrote: > On Apr 7, 2010, at 9:25 AM, Bryan Larsen wrote: > > > This is what owner associations were designed to handle. Tutorial > > here: > >http://cookbook.hobocentral.net/tutorials/agility#project-belongs-to-... > > > Bryan > > I think the original post was looking for a stronger level of user > isolation - in other words, having /projects show *just* the users > projects, with no overlap. The DRYest way I can think of to handle > this goes back to resource_controller, one of Hobo's early inspirations. > > Redefining 'model' on the controller should work: > > class TasksController < ApplicationController > hobo_model_controller > > auto_actions :all > > def model > current_user.administrator? ? Task : current_user.tasks > end > end > > (the administrator check is just an example; not sure if the OP's app > will need it) This *should* work, since calls like 'model.user_find' > and the like will proxy back through the association. > > Hope this helps! > > --Matt Jones -- 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.
