Quite a complicated subject for a post. 🙂 Hope at least some of you have an idea about the topic of this post.
Activescaffold supports concept of an inline actionlink, which is basically just a list column as a hyperlink. Out of the box it is used for associations to have a one click path to associated records. Unfortunetly, it was nt supported for singular polymorphic associations and in one of my projects I was missing this feature. I had to implement a log feature using a database as store. Each log statement should include a reference to the source. source was a perfect candidate for a polymorphic association.
I just had to extend activescaffold to support singular polymorphic assocation inline actionlinks.
I ve prepared a simple example app including invoice and applog model for those of you who are interesting in trying out.
Setup Example Application
- Download: one_step_active_scaffold
- Download: polymorphici_blog.rb and rename it to model_setup.rb
- Execute following command: ruby one_step_activescaffold.rb polymorphic_app jquery
- cd polymorphic_app
- rails s
- Create new invoice with a log entry