Hello RoR community,
I have a problem with the helpers in Rails 1.2.3.
HTML:
<table border="0" cellspacing="0"
cellpadding="0" id="questionTable"
class="sortable">
<thead>
<tr>
<th>#</th>
<th>Question name</th>
<th>Class</th>
<th>Type</th>
<th>Level</th>
<th>Question text</th>
<th> </th>
</tr>
</thead>
<tbody>
<tr>
<th>1</th>
<th>test</th>
<th>test</th>
<th>test</th>
<th>test</th>
<th>test</th>
<th>test</th>
</tr>
<tr>
<th>2</th>
<th>test2</th>
<th>test2</th>
<th>test2</th>
<th>test2</th>
<th>test2</th>
<th>test2</th>
</tr><!-- and much more -->
</tbody>
</table>
What do I need? I need to insert into the tbody the tr record
(<tr><td>..</td></tr>) before all tbody''s tr
elements.
How did I try? RJS:
page.insert_html :before, page.select(''#questionTable tbody
tr'').first, render(:partial => ''question'', :locals
=> { :q =>
question_copy })
Not working, but JS:
new Insertion.After($$("#questionTable tbody").first(),
"<tr><td>asdasdas</td></tr>");
Work''s perfectly.
How I can solve this problem?
Dmitry
--~--~---------~--~----~------------~-------~--~----~
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
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---