Formtastic input for polymorphic belong to relationships
Ruby JavaScript
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
app
lib
.gitignore
README.markdown
polymorphic_select.gemspec

README.markdown

Polymorphic Select

Have a polymorphic belongs to relationship? Need to show it on a form? How you going to do that?

No worries, friendo. I got you covered:

f.input :featuring,
        as: :polymorphic_select,
        grouped_options: {
          Animal  => Animal.by_name,
          Exhibit => Exhibit.by_name
        }

Code At Viget

Visit code.viget.com to see more projects from Viget.