fix pool version link

This commit is contained in:
albert
2013-02-04 18:34:25 -08:00
parent 838f8cb77d
commit 1506fe88cd
4 changed files with 6 additions and 28 deletions

View File

@@ -1,30 +1,4 @@
class StaticController < ApplicationController
def benchmark
n = 1_000
Benchmark.bm do |x|
x.report("default") do
n.times do
view_context.link_to("test", :controller => "posts", :action => "index", :tags => "abc")
end
end
x.report("posts_path") do
n.times do
view_context.link_to("test", posts_path(:tags => "abc"))
end
end
x.report("fast link to") do
n.times do
view_context.fast_link_to("test", :controller => "posts", :action => "index", :tags => "abc")
end
end
end
render :nothing => true
end
def terms_of_service
render :layout => "blank"
end

View File

@@ -43,6 +43,10 @@ class WikiPage < ActiveRecord::Base
if params[:creator_name]
q = q.where("creator_id = (select _.id from users _ where lower(_.name) = ?)", params[:creator_name].downcase)
end
if params[:sort] == "time"
q = q.order("updated_at desc")
end
q
end

View File

@@ -18,7 +18,7 @@
<% @pool_versions.each do |pool_version| %>
<tr>
<td><%= pool_version.pool.name %></td>
<td><%= link_to pool_version.post_id_array.size, pool_versions_path(pool_version) %></td>
<td><%= link_to pool_version.post_id_array.size, pool_version_path(pool_version) %></td>
<td><%= pool_version_diff(pool_version) %></td>
<td><%= link_to pool_version.updater.name, user_path(pool_version.updater) %></td>
<td>

View File

@@ -1,5 +1,5 @@
<section>
<h1>Recent Changes (<%= link_to "all", wiki_pages_path(:meta_sort => "updated_at.desc") %>)</h1>
<h1>Recent Changes (<%= link_to "all", wiki_pages_path(:sort => "time") %>)</h1>
<ul>
<% WikiPage.recent.each do |page| %>
<li class="category-<%= page.category_name %>"><%= link_to page.pretty_title, wiki_page_path(page) %></li>