On Tue, Oct 6, 2015 at 12:07 PM, tom <[email protected]> wrote: > its just pseudo-code. > > but if i leave the base resource in there, then it give me an /animal/id > route which i dont want. i want either /tiger/id or lion/id
Then you need to know whether your animal is a tiger or lion (or bear of course), and call the appropriate path helper. That kind of messiness is exactly what inheritance (and other forms of polymorphism) are great at solving. -- Dave Aronson, consulting software developer of Codosaur.us, PullRequestRoulette.com, Blog.Codosaur.us, and Dare2XL.com. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAHxKQijL3jK-BtREipAUeH-O46PYvbTjMD7M1vARBMhcGD8t%3Dg%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.

