Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
made articles per page into config param
  • Loading branch information
Pete Skomoroch committed Jun 3, 2009
1 parent c08a194 commit daceb74
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/controllers/pages_controller.rb
Expand Up @@ -11,7 +11,7 @@ def auto_complete_for_search_query
end

def index
@pages = Page.paginate :page => params[:page], :order => 'total_pageviews DESC', :per_page => 10
@pages = Page.paginate :page => params[:page], :order => 'total_pageviews DESC', :per_page => APP_CONFIG['articles_per_page']
@page = Page.first(:order => 'total_pageviews desc')
unless params[:page]
params[:page]='1'
Expand Down
2 changes: 1 addition & 1 deletion app/views/pages/index.html.erb
Expand Up @@ -19,7 +19,7 @@
</tr>
<% @pages.each_with_index do |page, index| %>
<tr>
<td><%= index + 1 + 10*(params[:page].to_i - 1) %></td>
<td><%= index + 1 + APP_CONFIG['articles_per_page']*(params[:page].to_i - 1) %></td>
<td><%= number_with_delimiter(page.total_pageviews, ',') %></td>
<td><%= link_to page.title, page %><BR><%= image_tag page.sparkline.to_url %> </td>
<td><%= link_to 'http://en.wikipedia.org/wiki/' + page.url, 'http://en.wikipedia.org/wiki/' + page.url %></td>
Expand Down

0 comments on commit daceb74

Please sign in to comment.