Guest

Untitled

By: a guest on Jan 28th, 2012  |  syntax: None  |  size: 0.60 KB  |  hits: 30  |  expires: Never
download  |  raw  |  embed  |  report abuse
Copied
  1. %h1 Listing pages
  2.  
  3. %table
  4.         %tr
  5.                 %th     ID
  6.                 %th     Name
  7.                 %th     Page Name
  8.                 %th     Title
  9.                 %th     Parent
  10.                 %th     Page Type
  11.                 %th{:colspan => 3} Actions
  12.                
  13.         - Page.all.each do |page|
  14.                 %tr
  15.                         %td= h page.id
  16.                         %td= h page.name
  17.                         %td= h page.page_name
  18.                         %td= h page.title
  19.                         %td= h page.parent.nil? ? "n/a" : page.parent.page_name
  20.                         %td= h PageType[page.page_type].display
  21.                         %td{:class => :actions}
  22.                                 = link_to 'Show', page
  23.                                 |
  24.                                 = link_to 'Edit', edit_page_path(page)
  25.                                 |
  26.                                 = link_to 'Destroy', page, :confirm => 'Are you sure?', :method => :delete
  27. %br
  28. = link_to 'New page', new_page_path