Thanks Christophe, however this doesn't really answer my query.
Currently I have:
<% for piece in @pieces %>
<%= image_tag "/images/#{piece[:name]}", :id =>
"piece_#{piece[:id]}" %>
<%= draggable_element "piece_#{piece[:id]}", :revert
=> true %>
<% end %>
Which is producing:
<img alt="Tile6" id="piece_6"
src="/fractals/images/tile6.gif?1158726306" />
<script type="text/javascript">
//<![CDATA[
new Draggable("piece_6", {revert:true})
//]]>
</script>
<img alt="Tile14" id="piece_14"
src="/fractals/images/tile14.gif?1158726306" />
<script type="text/javascript">
//<![CDATA[
new Draggable("piece_14", {revert:true})
//]]>
</script>
The current implementation is just using a 2 hash array but imagine the
amount is data for a 324 sized hash array.
This code:
['about-bubble','ref-bubble','downloads-bubble','docs-bubble'].each(function(b){
new Draggable(b,{revert:true,handle:b+'-handle'});
});
Is not mine, this is the source javascript (check the index) I found on
the script.aculo.us site. I'm hoping to see how this was written in the
view file.
Cheers
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Spinoffs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-spinoffs
-~----------~----~----~----~------~----~------~--~---