-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added filtering for polymorphic association objects
Until now, for polymorphic associations, a simple select tag was used, without filtering option. This commit adds filtering that easily works with switching association class. For each association class we need a path to load records from. For simple association, this is hardcoded in the `select` tag, for polymorphic one, we need to save them (a div with specific `data` attribute is generated) and switch whenever object type is switched. Switching type is a 3 step process: * update `data-options` attribute of select tag * destroy filtering object * create filtering object with new options Additionally, to avoid weird CSS behaviour, a fix to CSS generation was introduced. Without it, the object type field was moved to the right (since object value field had `float: left;` attribute set Use filter select for polymorphic association fields
- Loading branch information
Showing
3 changed files
with
33 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters