move explore links to sidebar, fix popular searches action

This commit is contained in:
r888888888
2017-11-13 11:14:09 -08:00
parent e739dc77d7
commit 36948bbf33
8 changed files with 45 additions and 22 deletions

View File

@@ -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