Forum: Ruby on Rails Create dynamic search with table rows

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
5dd60445347fc3dec62474cc732fef0d?d=identicon&s=25 Kyle Mathews (Guest)
on 2005-12-18 17:01
(Received via mailing list)
I'm trying to create a dynamic search function to filter the list
results using form_remote_tag. I need this to work with a table data
output. So it would update the partial template of table rows. I
tried wrapping the table rows in a div tag but that wouldn't update
the table properly. Any help on this would be greatly appreciated.

Here is my code:

<%= form_remote_tag :update => "student_list", :url => { :action =>
"list" } %>
	<input type="text" name="q" size="35" value="<%= params[:q] %>" />
	<%= submit_tag "Search" %>
</form>

<table cellspacing="1" cellpadding="2" class="list_table">
<tr>
    	<th>Name</th>
	<th>Grade</th>
	<th>School</th>
	<th>&nbsp;</th>
</tr>

<div id="student_list">
	<%= render :partial => "student_list", :collection => @students %>
</div>
</table>
821395fe70906c8290df7f18ac4ac6cf?d=identicon&s=25 Rick Olson (Guest)
on 2005-12-18 17:04
(Received via mailing list)
Try using thead and tbody...

<table cellspacing="1" cellpadding="2" class="list_table">
<thead>
  <tr>
        <th>Name</th>
        <th>Grade</th>
        <th>School</th>
        <th>&nbsp;</th>
  </tr>
</thead>

<tbody id="student_list">
        <%= render :partial => "student_list", :collection => @students
%>
</tbody>
</table>



--
rick
http://techno-weenie.net
5dd60445347fc3dec62474cc732fef0d?d=identicon&s=25 Kyle Mathews (Guest)
on 2005-12-18 20:05
(Received via mailing list)
That worked great, thanks.
This topic is locked and can not be replied to.