Quick question regarding RJS and inserting to the top of a table. Here's
the view I'm working with:
Code:
<table id="links-list">
  <tr>
   <th>Display title</th>
   <th>URL</th>
   <th>Description</th>
   <th>Category</th>
  </tr>
<% for link in @links %>
  <tr id="link-<%= h link.id %>">
   <td><%= h link.name %></td>
   <td><%= link_to h(link.url), h(link.url) %></td>
   <td><%=h link.description %></td>
   <td><%=h link.category.name %></td>
   <td><%= link_to 'Edit', :action => 'edit', :id => link %></td>
   <td><%= link_to 'Delete', { :action => 'destroy', :id => link },
:confirm => 'Are you sure?', :post => true %></td>
  </tr>
<% end %>
</table>
and the create.rjs file:
Code:
if @saved
  page.insert_html :top, 'links-list', :partial => 'link', :object =>
@link
  page.visual_effect :highlight, "link-#{@link.id}"
  page['link_url'].value = 'http://'
  page['link_name'].value = ''
  page['link_description'].value = ''
else
  # not saved, so send back the error messages and new form
end
...My question is, how can I insert the new link partial (a table row)
below the row containing the <th>'s in my view? As is, the new link row
is inserted before the table headers and not below. One more quickie: is
there any way to specify the title attribute of a link when using
link_to?? Thanks.