mirror of
https://github.com/basecamp/once-campfire.git
synced 2026-10-07 15:20:08 +09:00
Replace Trix with Lexxy
This commit is contained in:
@@ -1,11 +1,22 @@
|
||||
class Autocompletable::UsersController < ApplicationController
|
||||
def index
|
||||
set_page_and_extract_portion_from find_autocompletable_users.with_attached_avatar.ordered, per_page: 20
|
||||
|
||||
respond_to do |format|
|
||||
format.html { render layout: false } # <lexxy-prompt-item> elements for the mentions prompt
|
||||
format.json
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
def find_autocompletable_users
|
||||
params[:query].present? ? users_scope.active.filtered_by(params[:query]) : users_scope.active
|
||||
query.present? ? users_scope.active.filtered_by(query) : users_scope.active
|
||||
end
|
||||
|
||||
# The rich text editor's mentions prompt filters with `filter`, the
|
||||
# autocomplete inputs with `query`
|
||||
def query
|
||||
params[:filter].presence || params[:query].presence
|
||||
end
|
||||
|
||||
def users_scope
|
||||
|
||||
Reference in New Issue
Block a user