Listing pages

<% @pages.each do |page| %> <% end %>
Name Children Layout Parent Position Published? Action
<%= link_to page.name, admin_page_path(page) %>
    <% page.children.each do |child| %>
  • <%= child.name %>
  • <% end -%>
<%= page.layout_name %> <%= page.parent_page_id %> <%= page.position %> <%= page.is_published.to_s %> <%= link_to 'Edit', edit_admin_page_path(page) %> | <%= link_to 'Add Child', new_admin_page_path( :parent_page_id => page.id ) %> | <%= link_to 'Destroy', admin_page_path(page), :confirm => 'Are you sure?', :method => :delete %>

<%= link_to 'New pages', new_admin_page_path, :class => 'button positive' %>