public
Description: The open source social networking platform in Ruby on Rails from the author of RailsSpace
Homepage: http://insoshi.com
Clone URL: git://github.com/insoshi/insoshi.git
Michael Hartl (author)
Fri Apr 04 16:43:43 -0700 2008
insoshi / app / views / posts / blog_index.html.erb
100644 45 lines (38 sloc) 1.358 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<%- column_div :type => :primary do -%>
  
  <h1>Blog</h1>
  <div class="blog section clear">
    <div class="element">
    <%- @posts.each do |post| -%>
      <div class="title">
        <a name="post_<%= post.id %>"></a>
        <%= link_to sanitize(post.title), blog_post_path(@blog, post) %>
        <%- if current_person?(@blog.person) -%>
          | <%= link_to "Edit", edit_blog_post_path(@blog, post) %>
          | <%= link_to "Delete", blog_post_path(@blog, post),
                                  :method => :delete %>
        <%- end -%>
        </div>
      <div class="time">
          Posted <%= time_ago_in_words(post.created_at) %> ago
          by <%= link_to @blog.person.name, @blog.person %>
      </div>
      <div class="body">
        <%= sanitize post.body %>
      </div>
      <div class="comments">
      <%- n = post.comments.count -%>
      <%= link_to pluralize(n, "comment"),
                  blog_post_path(@blog, post, :comments => n) %>
      </div>
    <%- end -%>
    </div>
  </div>
 
  <h3>Add new post</h3>
 
  <%= render :partial => 'blog_form',
             :locals => { :url => blog_posts_path(@blog),
                          :method => :post } %>
 
  <%= link_to 'Back', blog_posts_path(@blog) %>
 
<%- end -%>
 
<%- column_div :type => :secondary do -%>
  <%= render :partial => 'shared/minifeed' %>
<%- end -%>