I'm building a site that has user defined pages that are composed of a set of widgets.
The widgets are fairly basic, similar to what you'd find in Blogger. Some widgets are for data collection/formatting presentation with basic structure (lists, tables) and others provide more complex functionality (blog, photo albums, etc)
I want to allow the user to select which widgets appear on their page and reorder them.
I was considering having Widgets be a STI (e.g. BlogWidget, GalleryWidget) and each Widget instance would have a fkey user_id and a position for sorting.
Then the user's show.html.erb would contain:
for widget in current_user.widgets
render widget
end
Is there a better way?