I created a simple widget based on the example provided at http://www.igvita.com/2007/06/05/creating-javascript-widgets-in-rails/
I currently invoke the widget using the following code:
<script type="text/javascript" src="http://yoursite.com/widget/user_bookmarks/A4923D2342JF"> </script>
However, I would like to pass it using a few options like:
1. Number of bookmarks
2. Layout: horizontal/vertical
3. size:
Ideally, I would like to call it like:
<script type="text/javascript">
var widgetOptions = {
key: 'A4923D2342JF',
layout: 'horizontal',
numBookmarks: 3;
};
http://yoursite.com/widget/user_bookmarks //Is this how you invoke?
How do I pass the options to the bookmarks widget controller?
Better yet, is is possible to leave the styling out of the rails code and let the user style is anyway they want easily?