<h1>My notes</h1>

<table>
    
<% for note in @notes %>
  <tr>
  <td colspan="4"><%= h(note.title) %><br />
  <%= note.created_at.strftime("%Y-%m-%d %H:%M") %><br />
  <%= h(truncate(note.story, 80)) %>
  </td>
  </tr>
	<tr>
     <td><%= link_to 'Show', :action => 'show', :id => note %></td>
      <% if !@session['user'].nil? %>
    <td><%= link_to 'Edit', :action => 'edit', :id => note %></td>
    <td><%= link_to 'Destroy', { :action => 'destroy', :id => note }, :confirm => 'Are you sure?', :post => true %></td>
  <td><%= link_to 'New', :action => 'new' %></td>
  <% end %>
    </tr>
<% end %>
</table>
 <% if !@session['user'].nil? %>
 <%= link_to "&#171; logout", :controller => 'user', :action=>"logout"%>
 <% end %>
<%= link_to 'Previous page', { :page => @note_pages.current.previous } if @note_pages.current.previous %>
<%= link_to 'Next page', { :page => @note_pages.current.next } if @note_pages.current.next %> 




