<h1><%= @title || "Listing posts" %></h1>

<%= magic_grid @posts, [:title, :body, :published, :user, 'Actions'],
  :searchable => [:body, 'users.name'], :id => 1 do |post| %>
  <tr>
    <td><%= post.title %></td>
    <td><%= post.body.truncate(30) %></td>
    <td><%= post.published %></td>
    <td><%= link_to post.user, post.user %></td>
    <td>
      <%= link_to 'Show', post %>
      <%= link_to 'Edit', edit_post_path(post) %>
      <%= link_to 'Destroy', post, confirm: 'Are you sure?', method: :delete %>
    </td>
  </tr>
<% end %>

<%= link_to 'New Post', new_post_path %>

<h1><%= @title || "Listing posts" %></h1>

<%= search_field_tag :posts_search %>
<%= magic_grid @posts, [:title, :body, :published, :user, 'Actions'],
  :searchable => [:body, 'users.name'], :searcher => :posts_search,
  :id => 1, :ajax => true do |post| %>
  <tr>
    <td><%= post.title %></td>
    <td><%= post.body.truncate(30) %></td>
    <td><%= post.published %></td>
    <td><%= link_to post.user, post.user %></td>
    <td>
      <%= link_to 'Show', post %>
      <%= link_to 'Edit', edit_post_path(post) %>
      <%= link_to 'Destroy', post, confirm: 'Are you sure?', method: :delete %>
    </td>
  </tr>
<% end %>

<%= link_to 'New Post', new_post_path %>

Update test/demo to use live search
Update test/demo to use live search
