Forum: Ruby on Rails Best Practice for nested resources

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Bbf55d9960b9905e57621d5da6727b2d?d=identicon&s=25 Neal L (Guest)
on 2009-01-23 23:10
(Received via mailing list)
Hi all,

I'm writing an app that has a reporting component.  All of the reports
are in a controller called reports_controller.  I'm using REST routes,
and I'd like to do something like:

/properties/1/myreport

and have it call the myreport action of the reports controller.  Is
there a way to do this?  Is this where I would use something like:

map.resources :properties do |property|
  ~~ something here to reference myreport ??? ~~
end

Thanks!
9cfde8cbd74e3fb79d41cba817f5d7b8?d=identicon&s=25 Melvin Ram (melvinram)
on 2009-01-24 08:17
(Received via mailing list)
You might want to check out resource_controller

http://jamesgolick.com/2007/10/19/introducing-reso...
This topic is locked and can not be replied to.