On Tue, Oct 6, 2015 at 12:07 PM, tom <tomabroad@gmail.com> 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 rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
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.
No comments:
Post a Comment