Permalink
Browse files

remove blog/all, show all previous posts on /blog

  • Loading branch information...
1 parent b836cb8 commit 7a76b95e9f056c1ef3d5f74e84bf5af3e9eea5a5 @charliesome committed Jan 10, 2013
Showing with 3 additions and 30 deletions.
  1. +1 −7 app.rb
  2. +2 −2 models/post.rb
  3. +0 −21 views/blog_all.erb
View
8 app.rb
@@ -59,12 +59,6 @@ def abbreviated_post(source)
erb :blog_rss, layout: false
end
-get "/blog/all" do
- @posts = Post.recent :all
- @title = "All posts"
- erb :blog_all
-end
-
get "/blog/:slug.md" do
post = Post.find params[:slug]
content_type "text/plain"
@@ -94,4 +88,4 @@ def abbreviated_post(source)
get "/style.css" do
scss :style
-end
+end
View
@@ -31,8 +31,8 @@ def self.clear_cache!
@@all = nil
end
- def self.recent(n = 5)
- all.to_a.last(n).map { |k,v| v }.reverse
+ def self.recent
+ all.to_a.map { |k,v| v }.reverse
end
def self.latest
View
@@ -1,21 +0,0 @@
-<div class="past-posts">
- <h3>Past Posts</h3>
-
- <ul>
- <% @posts.each_with_index do |post, index| %>
- <li>
- <div class="masthead">
- <h4>
- <a href="<%= post_path post %>"><%= post.title %></a>
- </h4>
- <span class="date">
- posted <%= time_ago_in_words post.created_at %> ago
- </span>
- </div>
- </li>
- <% if index.odd? %>
- <div style="clear:both;"></div>
- <% end %>
- <% end %>
- </ul>
-</div>

0 comments on commit 7a76b95

Please sign in to comment.