hpi-swt2/vm-portal

Refactor routes.rb

Closed this issue · 2 comments

  • rootseems to be routed twice
  • Little usage of scopes
  • Little usage of Rails resource helpers
  • Little structure
  • Why are params in routes constrained to { id: /.*/ }? Are params strings and not ids? EDIT: Yes

the route to reject a request was defined as patch '/vms/requests/reject', to: 'requests#reject', as: 'reject', now it's

  scope 'vms' do
    resources :requests, path: 'requests' do
      patch :reject, on: :collection
    end
  end

No :id param is passed in the route. However, reject in app/controllers/requests_controller.rb uses a param...

Fixed in #464