I have a class, DynamicPage, and a subclass, ContentPage. Dynamic Pages have a content_page attribute to distinguish them.
I have 2 wildcard routes set up as follows:
resources :dynamic_pages, path: '', param: :dynamic_page_id
get "*dynamic_page_id/trackback", to: "dynamic_pages#show"
get "*dynamic_page_id", to: "dynamic_pages#show"
and
resources :content_pages, path: '', param: :content_page_id
get "*content_page_id/trackback", to: "content_pages#show"
get "*content_page_id", to: "content_pages#show"
These routes lead to the relevant controller depending on which route I place first . Let us assume the dynamic page being shown is called dp. What I want to do is change the route depending on whether dp.content_page is true or not. Is this possible in the routes? Or would I need to redirect in one of the controllers?
Thanks.