1) It's current_user inside controller's or views. acting_user inside
models. (Yes, there are rare occasions when they're not the same).
2) Rather than changing the index, what I would do would change your
links to `index_for_user_path(current_user)`, which will translate into
/users/:user_id/foos Then you won't need a custom controller.
Bryan
On 11-01-22 11:48 AM, Henry H wrote:
Okay I followed the examples and got a little further, but I'm not
able to figure out how to limit the index views to only the user who
owns those items. Am I supposed to define my own index function, use
the hobo_index command, and add a scoping filter to the controller? I
tried the following, but it didn't know who the acting user was...
def index
hobo_index(model,:conditions =>["user_id == ?",acting_user])
end
Can anyone post an example?
Thanks,
Henry
On Jan 20, 3:47 am, Henry H<[email protected]> wrote:
Thanks Bryan. I'll take a look.
On Jan 19, 9:22 pm, Bryan Larsen<[email protected]> wrote:
You're looking for the "owner actions".
http://cookbook.hobocentral.net/manual/controllers#owner_actions
http://cookbook.hobocentral.net/tutorials/agility#project_ownership
I know the pdf's have a section corresponding to that agility section,
but I don't know which it is.
Bryan
On 11-01-19 08:30 PM, Henry H wrote:
I want to built a site which allows multiple users to enter
information which is only available to themselves. I'm getting
permission issues which cause errors when I create items which require
the owner to be the current user because the index pages try and list
items from other users.
I've gone through both PDF tutorials and was able to follow them quite
easily (great job on this folks!). Can someone post a quick example
of how I should be approaching this particular usage scenario? I'm
guessing I have to write something custom, but I'm hoping this is
somehow built into the hobo framework so it's easy to have a user just
see the things they are creating, editing, etc. versus all things
created by all users.
Thanks so much,
Henry
--
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.