recommendations: add search form, allow searching by username.
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
class RecommendedPostsController < ApplicationController
|
||||
respond_to :html, :json, :xml, :js
|
||||
|
||||
def show
|
||||
def index
|
||||
limit = params.fetch(:limit, 100).to_i.clamp(0, 200)
|
||||
@recs = RecommenderService.search(params).take(limit)
|
||||
@recs = RecommenderService.search(search_params).take(limit)
|
||||
@posts = @recs.map { |rec| rec[:post] }
|
||||
|
||||
respond_with(@recs)
|
||||
|
||||
Reference in New Issue
Block a user