I have 2 Models, 'Device' and 'DeviceActivity' where Device has many Device Activities. Now if i would use regular resource nesting i would end up with something like
/devices/1/activities
or
/devices/1/activities/1
What i want is to access
/devices/activities
where i want to show all activities of all devices, like an activity stream. Is creating a collection on the Devices resource the right way?
This is the solution
resources :devices do
collection do
resources :activities, :controller => 'device_activities'
end
end
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With