M
macaco
[Note: parts of this message were removed to make it a legal post.]
Hi list
I'v been wondering how to make an 'each' or a loop or something so I don't
have to write this code N times:
<div id="list">
<div id="dragg0" class="green box"
style="position:absolute;top:190px;left:55px"><div class="handler"
id="handler0">Imagen 0</div><%= link_to_remote
image_tag("/generate/imagen/0"), :url => {:action=> "generate", :id => 0},
:update => "show_div" %></div>
<%= draggable_element :dragg0, :handle => "'handler0'" %>
<div id="dragg1" class="green box"
style="position:absolute;top:190px;left:240px"><div class="handler"
id="handler1">Imagen 1</div><%= link_to_remote
image_tag("/generate/imagen/1"), :url => {:action=> "generate", :id => 1},
:update => "show_div" %></div>
<%= draggable_element :dragg1, :handle => "'handler1'" %>
# the same for N images
</div>
<span id="show_div"></span>
As you can see, it's just the same code but the Id of the image and a
position. But If I put this code in the controller, I can't create those
<%= %> tags, they won't be recognized. Or at least it didn't for me.
Any idea, shall I make it in the controller? it's there a way to do it in
the .rhtml?
Hi list
I'v been wondering how to make an 'each' or a loop or something so I don't
have to write this code N times:
<div id="list">
<div id="dragg0" class="green box"
style="position:absolute;top:190px;left:55px"><div class="handler"
id="handler0">Imagen 0</div><%= link_to_remote
image_tag("/generate/imagen/0"), :url => {:action=> "generate", :id => 0},
:update => "show_div" %></div>
<%= draggable_element :dragg0, :handle => "'handler0'" %>
<div id="dragg1" class="green box"
style="position:absolute;top:190px;left:240px"><div class="handler"
id="handler1">Imagen 1</div><%= link_to_remote
image_tag("/generate/imagen/1"), :url => {:action=> "generate", :id => 1},
:update => "show_div" %></div>
<%= draggable_element :dragg1, :handle => "'handler1'" %>
# the same for N images
</div>
<span id="show_div"></span>
As you can see, it's just the same code but the Id of the image and a
position. But If I put this code in the controller, I can't create those
<%= %> tags, they won't be recognized. Or at least it didn't for me.
Any idea, shall I make it in the controller? it's there a way to do it in
the .rhtml?