Sha256: 2509cd5d9cb6255704ef5b58a2ea12392b16262c59ee087d0fa0d69c831d4cf2
Contents?: true
Size: 511 Bytes
Versions: 7
Compression:
Stored size: 511 Bytes
Contents
require_dependency "liquidum/application_controller" module Liquidum class CompletionsController < ApplicationController def index q = params[:q] klass = q.classify.safe_constantize drop = q.classify.concat('Drop').safe_constantize invokables = drop&.invokable_methods || [] # drop_relations = klass.reflect_on_all_associations.map(&:name).select {|n| invokables.include?(n.to_s) } render json: { q: q, completions: invokables } end end end
Version data entries
7 entries across 7 versions & 1 rubygems