0

I'm creating a rails app in this app I have Companies and each company has many jobs I’m wondering how can I route for all jobs of a company X so I will have a URL like this http://localhost:3000/companies/google/jobs

Loenvpy
  • 899
  • 1
  • 10
  • 30

1 Answers1

1

Ok i find the answer this is can be done by using member

  resources :companies do
    member do
      get 'jobs'
    end
  end

this will give the following url

/companies/company_id/jobs 
bjelli
  • 9,752
  • 4
  • 35
  • 50
Loenvpy
  • 899
  • 1
  • 10
  • 30