Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
hydra-role-management routes change to allow mounting at custom path
Hydra::RoleManagement::Engine.routes.draw do
#role_users POST /roles/:role_id/users(.:format) user_roles#create
# role_user DELETE /roles/:role_id/users/:id(.:format) user_roles#destroy
# roles GET /roles(.:format) roles#index
# POST /roles(.:format) roles#create
# new_role GET /roles/new(.:format) roles#new
# edit_role GET /roles/:id/edit(.:format) roles#edit
# role GET /roles/:id(.:format) roles#show
# PUT /roles/:id(.:format) roles#update
# DELETE /roles/:id(.:format) roles#destroy
get '/', to: 'roles#index', as: 'roles'
post '/', to: 'roles#create', as: 'roles'
get '/new', to: 'roles#new', as: 'new_role'
get '/:id/edit', to: 'roles#edit', as: 'edit_role'
get '/:id', to: 'roles#show', as: 'role'
put '/:id', to: 'roles#update', as: 'role'
delete '/:id', to: 'roles#destroy', as: 'role'
post '/:role_id/users', to: 'user_roles#create', as: 'role_users'
delete '/:role_id/users/:id', to: 'user_roles#destroy', as: 'role_user'
# Generic file routes
#resources :roles, as: '/' do
# resources :users, :only=>[:create, :destroy], :controller => "user_roles"
#end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.