brianto / lianxi

A fun and painless way of learning Chinese
3 stars 2 forks source link

Refactor flash cards to use Rails reflection item thing to deduce teachable #2

Closed brianto closed 11 years ago

brianto commented 11 years ago

http://pathfindersoftware.com/2008/07/drying-up-rails-controllers-polymorphic-and-super-controllers/

Something like params[:teachable_type].capitalize.constantize