Before I decided to leave work, I wanted to get this photo album system started. It’s polymorphic and allows users, videos, etc, to all have albums. I wanted to use a single controller, views, etc. Well, I never knew that you could do the following:
1 | <%= link_to 'Back', [:admin, @parent, :albums] %> |
Assuming @parent is the parent object owning the album, it will generate a link to /admin/videos/5/albums
How awesome is that.
Related posts: