Roles: index, new, create, edit, update, destroy
Rights: index, new, create, edit, update, destroy
Now, I guess, an explanation.
List and index should be interchangeable; just get rid of 'list' for
I assume there's a means of creating these rights/roles from the first
place. This form would usually be in a 'new' action (the form POSTs to
'create'). And while 'edit' is good to provide a GET form for a
record, the form would post (using PUT) to 'update' to write the
changes. 'Destroy' stays.
'map_rights' seems to be an 'update' action if it's modifying that
And finally, 'list_by_role' could be achieved with the following
map.resources :roles, :has_many => :rights
Now you have role_rights_path(@role), which will allow you to use the
RightsController#index action to list just the rights of a particular
role, as long as @role is established from params[:role_id]. You could
just detect with a before_filter:
if @role = Role.find params[:role_id]
@rights = @role.rights
@rights = Right.find :all
Now, the following two URLs will 'list' rights and 'list_by_role' with
Now, go convert all those crudful controllers!