Re: Restful Authentication with all the bells and whistles (new 9/05/08)
I followed the old tutorial outlined in post 246 and I have gotten what I want working from it, namely the admin panel.
My app is such that a user belongs to a specific organisation and each organisation has its own collection of movies. Each user can only view the organisation it belongs to movies'.
I am now trying to add the functionality of the admin being able to set a user's organisation.
So the link in _user.html.erb
<td><%= link_to 'edit roles', user_roles_path(user) %></td>works perfectly but when I try to copy it and create
<td><%= link_to 'edit organisation', user_organisations_path(user) %></td>I get a no such method exists error.
If I type "http://127.0.0.1:3001/users/27/roles" into the address bar while logged in as admin, I am taken to the roles page for user 27 but if I try "http://127.0.0.1:3001/users/27/organisations" I get "No action responded to 27. Actions: activate, create, destroy, edit, enable, index, new, show, and update".
My feeling is that this is occurring because a user has a role but a user belongs to an organisation. I've been playing about with it for a few hours and can't figure out a way to get it so I can edit a user's organisation as admin. I can do it as the user but this is not the behaviour I want.
Any help much appreciated.
Last edited by Cloud (2010-01-14 19:50:18)