14 lines
419 B
Ruby
14 lines
419 B
Ruby
class SearchesController < ApplicationController
|
|
include Turbo::DriveHelper
|
|
|
|
def show
|
|
@query = params[:q].blank? ? nil : params[:q]
|
|
if card = Current.user.accessible_cards.find_by_id(params[:q])
|
|
@card = card
|
|
else
|
|
set_page_and_extract_portion_from Current.user.search(params[:q])
|
|
@recent_search_queries = Current.user.search_queries.order(updated_at: :desc).limit(10)
|
|
end
|
|
end
|
|
end
|