I've got an article model which uses STI. The sub classes are emotions, categories, gateways etc...
In my routes I've got
resources :emotions, :controller => 'articles'
resources :categories, :controller => 'articles'
resources :gateways, :controller => 'articles'
This makes all the different sub classes available at /articles/108 or emotions/108 or categories/108 - it doesn't matter which subclass you stick at the front they all work for all articles.
I would like all my url helpers to produce links to articles/id - at the moment they still go to the particular sub class.
How would I go about doing this?
If article is the base class of another derived class like gateway (class Gateway < Article
), then maybe just use the urls generated by resources :articles
. It should be possible to use the articles helper article_path(gateway)
since the subclasses are derived from the base class.