There are some implementations that were mentioned by Ben Hughes, which are good examples and would make good launching points. If you wanted to roll your own solution from scratch, I'd suggest something like the following:
Create two tables/models, Widgets and UserWidgets:
Widgets:
ID (Primary Key)
Name
Description
UserWidgets:
ID (Primary Key)
User_ID (Foreign Key -> Users.ID)
Widget_ID (Foreign Key -> Widget.ID)
Now you have a table for associating a user to widget. I'm assuming your widgets will be handled primarily via JavaScript, so add a new subdirectory, like so...
/public/javascripts/widgets
Now, for every widget in your Widgets table, add the appropriate JS file to this subdirectory. If you have a widget with the name "Clock", add "Clock.js".
Add the proper associations to the User Model.
has_many :user_widgets, :dependent => :destroy
has_many :widgets, :through -> :user_widgets
Then in a view somewhere, you can do:
<% @user.widgets.each do |w| %>
<%= javascript_include_tag "widgets/#{w}" -%>
<% end %>
This would likely be put into the layout for whatever page(s) a widget would be appearing on. If you don't want to use dynamic widgets via JavaScript, you can use very similar view code anywhere in a view/partial.