Colin Law wrote:
> 2009/6/11 Tyler Knappe <[email protected]>:
>>
>> page["test_div_7"].replace_html "Test 7"
>> "Checked Out"
>> else
>> page["test_div"].replace_html
>> "Available"
>> end
>> end
>> end
>> end
>>
>> Executing this code only updates a single element.
>
> I am presumably missing something here, as I do not know much about
> RJS, but inside the loop you seem to be replacing the html for the
> same div ("test_div") every time round the loop.
>
> Colin
Oh. :facepalm:
Does anyone know how to dynamically generate div tags?
I tried this:
<th><div id = "test_div_" + ij"" style = "display :inline;"> Available
</div></th>
Which didn't work, rather it gives me this in the source:
<th><div id = "test_div_" + ij"" style = "display :inline;">
Available </div></th>
The idea being that I would be able to use my loop to generate the div
tags.
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" 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-talk?hl=en
-~----------~----~----~----~------~----~------~--~---