Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Ticket #9621 (new enhancement)

Opened 2 years ago

Last modified 1 year ago

Polymorphic Associations and polymorphic_url

Reported by: bishop1847 Assigned to: core
Priority: normal Milestone: 2.x
Component: ActionPack Version: edge
Severity: normal Keywords:
Cc:

Description

I'm developing a CMS that displays a changelog for the following models:

- Page
- Asset
   - Stylesheet < Asset
   - Javascript < Asset
   - Code Block < Asset
   - Layout < Asset

I have PagesController as a mapped resource, along with AssetsController.

The problem I'm having comes when using polymorphic_url on any of classes that subclass Asset. It's trying to find the named routes stylesheet_url, javascript_url, etc. instead of asset_url (page_url works fine).

Change History

04/13/08 22:00:01 changed by lukemelia

Check #10454 for a dicussion.