0

I have created the following tables in my application - roles, permissions and permissions_roles. Roles HABTM permissions, and permissions HABTM roles. I have seen many tutorials on setting up all of the tables/models etc for the 3 tables and defining the relationship, but I haven't been able to find anything on actually maintaining the relationship -- What is the best practice -- set up a third controller/set of views?

I want to be able to create Roles/Permissions independently of the relationship, ie make the assignment later - If I create a new role, I may need to go back and assign existing permissions to it (or vice-versa).

I know there are plenty of plugins that do this sort of thing, but I really want to see if I can learn more by starting from the ground up...

Thanks

chip
  • 1

1 Answers1

0

Its a little bit dated, but should still work, I shudder at the verbosity of the code but it was one of the first things I did in Rails...

http://blog.wolfman.com/articles/2006/5/20/role-based-authentication-admin-page

Jim Morris
  • 2,870
  • 24
  • 15