move explore links to sidebar, fix popular searches action
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
module Explore
|
||||
class PostsController < ApplicationController
|
||||
respond_to :html, :xml, :json
|
||||
before_filter :set_date, only: [:searches, :viewed]
|
||||
|
||||
def popular
|
||||
@post_set = PostSets::Popular.new(params[:date], params[:scale])
|
||||
@@ -9,13 +10,12 @@ module Explore
|
||||
end
|
||||
|
||||
def viewed
|
||||
@post_set = PostSets::MostViewed.new(params[:date])
|
||||
@post_set = PostSets::MostViewed.new(@date.to_s)
|
||||
@posts = @post_set.posts
|
||||
respond_with(@posts)
|
||||
end
|
||||
|
||||
def searches
|
||||
@date = params[:date] ? Date.parse(params[:date]) : Date.today
|
||||
@search_service = PopularSearchService.new(@date)
|
||||
end
|
||||
|
||||
@@ -27,5 +27,10 @@ module Explore
|
||||
@presenter = IntroPresenter.new
|
||||
render :layout => "blank"
|
||||
end
|
||||
|
||||
private
|
||||
def set_date
|
||||
@date = params[:date] ? Date.parse(params[:date]) : Date.today
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user