@@ -42,11 +42,11 class NewsController < ApplicationController | |||
|
42 | 42 | @news_count = scope.count |
|
43 | 43 | @news_pages = Paginator.new @news_count, @limit, params['page'] |
|
44 | 44 | @offset ||= @news_pages.offset |
|
45 |
@newss = scope. |
|
|
46 |
|
|
|
47 | :offset => @offset, | |
|
48 | :limit => @limit) | |
|
49 | ||
|
45 | @newss = scope.includes([:author, :project]). | |
|
46 | order("#{News.table_name}.created_on DESC"). | |
|
47 | limit(@limit). | |
|
48 | offset(@offset). | |
|
49 | all | |
|
50 | 50 | respond_to do |format| |
|
51 | 51 | format.html { |
|
52 | 52 | @news = News.new # for adding news inline |
General Comments 0
You need to be logged in to leave comments.
Login now