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

<%= magic_grid(@posts, [ :title, {:col => :body, :to_s => Proc.new {|r| r.body.truncate(30)} }, :published, :user, { :label => 'Actions', :to_s => Proc.new { |post| %> <%= link_to 'Show', post %> <%= link_to 'Edit', edit_post_path(post) %> <%= link_to 'Destroy', post, confirm: 'Are you sure?', method: :delete %> <% } } ], :searchable => [:body, 'users.name'], :per_page => 5, :id => 2, :remote => true) %>